openbsd-ports/converters/mpack/patches/patch-unixos_c

48 lines
1.1 KiB
Plaintext

$OpenBSD: patch-unixos_c,v 1.5 2012/10/21 12:59:43 jasper Exp $
Fixes from Sebastian Pipping
http://git.goodpoint.de/?p=mpack.git;a=commitdiff;h=0c87201f64491575350b18d04c62ec142e119d1f
--- unixos.c.orig Mon Jul 21 22:54:05 2003
+++ unixos.c Sun Oct 21 14:55:35 2012
@@ -30,6 +30,7 @@
#include <sys/param.h>
#include <netdb.h>
#include <fcntl.h>
+#include <stdlib.h>
#include "xmalloc.h"
#include "common.h"
#include "part.h"
@@ -38,10 +39,6 @@
#define MAXHOSTNAMELEN 64
#endif
-extern int errno;
-extern char *malloc();
-extern char *getenv();
-
int overwrite_files = 0;
int didchat;
@@ -90,7 +87,7 @@ char *os_idtodir(char *id)
strcpy(buf, getenv("TMPDIR"));
}
else {
- strcpy(buf, "/usr/tmp");
+ strcpy(buf, "/var/tmp");
}
strcat(buf, "/m-prts-");
p = getenv("USER");
@@ -137,9 +134,9 @@ FILE *os_createnewfile(char *fname)
FILE *ret;
#ifdef O_EXCL
- fd=open(fname, O_RDWR|O_CREAT|O_EXCL, 0644);
+ fd=open(fname, O_RDWR|O_CREAT|O_EXCL, 0600);
#else
- fd=open(fname, O_RDWR|O_CREAT|O_TRUNC, 0644);
+ fd=open(fname, O_RDWR|O_CREAT|O_TRUNC, 0600);
#endif
if (fd == -1)