mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-09-23 03:33:34 -04:00
37 lines
1.1 KiB
Plaintext
37 lines
1.1 KiB
Plaintext
$NetBSD: patch-ab,v 1.8 2010/09/19 07:52:19 obache Exp $
|
|
|
|
--- db.c.orig 2010-08-20 04:04:35.000000000 +0000
|
|
+++ db.c
|
|
@@ -28,6 +28,7 @@
|
|
#include <string.h>
|
|
#include <sys/stat.h>
|
|
#include <ctype.h>
|
|
+#include <errno.h>
|
|
|
|
#ifndef NUTDIR
|
|
char nutdir1[]=".nutdb";
|
|
@@ -982,9 +983,22 @@ strcpy(subuser,sub);
|
|
sprintf(versionfile,"%s/%s/%s","NUTDB",subuser,versionfile1);
|
|
#else
|
|
sprintf(nutdir,"%s/%s",getenv("HOME"),nutdir1);
|
|
-mkdir (nutdir, 0700 );
|
|
+if (mkdir(nutdir, S_IRWXU|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) != 0) {
|
|
+ if (errno != EEXIST) {
|
|
+ printf("Cannot create %s: %s\n", nutdir,
|
|
+ strerror(errno));
|
|
+ exit(1);
|
|
+ }
|
|
+}
|
|
sprintf(nutdirsubuser,"%s/%s/%s",getenv("HOME"),nutdir1,subuser);
|
|
mkdir (nutdirsubuser, 0700 );
|
|
+if (mkdir(nutdirsubuser, S_IRWXU|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) != 0) {
|
|
+ if (errno != EEXIST) {
|
|
+ printf("Cannot create %s: %s\n", nutdirsubuser,
|
|
+ strerror(errno));
|
|
+ exit(1);
|
|
+ }
|
|
+}
|
|
sprintf(USDAjoined,"%s/%s",FOODDIR,USDAjoined1);
|
|
sprintf(globalFOOD,"%s/%s",FOODDIR,globalFOOD1);
|
|
sprintf(globalNUT,"%s/%s",FOODDIR,globalNUT1);
|