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
|
$NetBSD: patch-ag,v 1.3 2002/11/03 21:32:26 wiz Exp $
--- src/main.c.orig Fri Oct 11 17:45:44 2002
+++ src/main.c
@@ -372,6 +372,23 @@ main (int argc, char *argv[])
dctc_dir=g_string_new(NULL);
g_string_sprintf(dctc_dir,"%s/running",dctc_main_dir->str);
+ if(access(dctc_dir->str,R_OK|W_OK|X_OK))
+ {
+ if(errno==ENOENT)
+ {
+ if(mkdir(dctc_dir->str,0777))
+ {
+ perror("mkdir");
+ fprintf(stderr,"Unable to create %s, abort.\n",dctc_dir->str);
+ exit(1);
+ }
+ }
+ else
+ {
+ fprintf(stderr,"You have no access rights on %s, abort.\n",dctc_dir->str);
+ exit(1);
+ }
+ }
dctc_active_client_file=g_string_new(NULL);
g_string_sprintf(dctc_active_client_file,"%s/gstatus",dctc_main_dir->str);
|