blob: 266a874b43212f509badd291c92d16d16ae0192c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
$NetBSD: patch-ab,v 1.2 2004/04/01 18:38:03 jmmv Exp $
http://bugzilla.gnome.org/showattachment.cgi?attach_id=24286
--- libnautilus-private/nautilus-medusa-support.c 28 Oct 2001 20:21:46 -0000 1.11
+++ libnautilus-private/nautilus-medusa-support.c 10 Feb 2004 19:11:58 -0000
@@ -32,6 +32,7 @@
#include <eel/eel-string.h>
#include <dirent.h>
#include <stdio.h>
+#include <unistd.h>
#include <sys/types.h>
#ifdef HAVE_MEDUSA
@@ -52,6 +53,18 @@
NautilusCronStatus
nautilus_medusa_check_cron_is_enabled (void)
{
+#if defined(__NetBSD__)
+ /* In NetBSD, cron(8) is part of the base system and is configured
+ to store a pid file in /var/run/cron.pid while running. Instead
+ of walking the process table (which has its implications, since
+ proc is not mounted by default and has very strict permissions),
+ we can simply check for its existence. */
+
+ if (access("/var/run/cron.pid", F_OK) == -1)
+ return NAUTILUS_CRON_STATUS_OFF;
+
+ return NAUTILUS_CRON_STATUS_ON;
+#else
DIR *proc_directory;
struct dirent *file;
char *stat_file_name;
@@ -106,6 +119,7 @@
closedir (proc_directory);
return status;
+#endif
}
#ifdef HAVE_MEDUSA
|