summaryrefslogtreecommitdiff
path: root/net/dc_gui/patches/patch-ag
blob: ce43c6623e1e7f14596be561ed8233a672ca56ac (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
$NetBSD: patch-ag,v 1.2 2002/10/03 11:48:43 wiz Exp $

--- src/main.c.orig	Fri Aug 23 18:41:11 2002
+++ src/main.c
@@ -329,6 +329,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);