Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/pkg_install/lib use /var/tmp consistently. (XXX nee...
details: https://anonhg.NetBSD.org/src/rev/41c62326620f
branches: trunk
changeset: 488089:41c62326620f
user: hubertf <hubertf%NetBSD.org@localhost>
date: Sun Jun 18 01:29:17 2000 +0000
description:
use /var/tmp consistently. (XXX need to re-visit if we ever
put pkg_add on a install floppy)
diffstat:
usr.sbin/pkg_install/lib/ftpio.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diffs (77 lines):
diff -r dbfee94e0721 -r 41c62326620f usr.sbin/pkg_install/lib/ftpio.c
--- a/usr.sbin/pkg_install/lib/ftpio.c Sun Jun 18 00:02:50 2000 +0000
+++ b/usr.sbin/pkg_install/lib/ftpio.c Sun Jun 18 01:29:17 2000 +0000
@@ -1,8 +1,8 @@
-/* $NetBSD: ftpio.c,v 1.19 2000/06/08 00:26:48 hubertf Exp $ */
+/* $NetBSD: ftpio.c,v 1.20 2000/06/18 01:29:17 hubertf Exp $ */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: ftpio.c,v 1.19 2000/06/08 00:26:48 hubertf Exp $");
+__RCSID("$NetBSD: ftpio.c,v 1.20 2000/06/18 01:29:17 hubertf Exp $");
#endif
/*
@@ -462,7 +462,7 @@
char best[FILENAME_MAX];
int tfd;
- strcpy(tmpname, "/tmp/pkg.XXXXXX");
+ strcpy(tmpname, "/var/tmp/pkg.XXXXXX");
tfd=mkstemp(tmpname);
if (tfd == -1) {
warnx("Cannot generate temp file for ftp(1)'s nlist output");
@@ -520,6 +520,7 @@
* in findmatchingname() */
while (fgets(filename, sizeof(buf), f)) {
filename[strlen(filename)-1] = '\0';
+fprintf(stderr, "HF: pkg='%s', filename='%s'\n", pkg, filename);
if (pmatch(pkg, filename)) {
matches++;
@@ -657,7 +658,7 @@
char cmd[256];
char tmpdir[256];
- (void) snprintf(tmpdir, sizeof(tmpdir), "/tmp/dir%s",
+ (void) snprintf(tmpdir, sizeof(tmpdir), "/var/tmp/dir%s",
(getenv(PKG_FTPIO_CNT))?getenv(PKG_FTPIO_CNT):"");
mkdir(tmpdir, 0755);
@@ -674,7 +675,7 @@
/* check if one more file(s) exist */
if (0) {
char buf[FILENAME_MAX];
- (void) snprintf(buf, sizeof(buf), "nlist %s /tmp/xxx\n", pkg);
+ (void) snprintf(buf, sizeof(buf), "nlist %s /var/tmp/xxx\n", pkg);
rc = ftp_cmd(buf, "\n(226|550).*\n"); /* catch errors */
if (rc != 226) {
if (Verbose)
@@ -689,15 +690,15 @@
return -1;
}
- if (access("/tmp/xxx", R_OK)==0) {
- system("cat /tmp/xxx");
+ if (access("/var/tmp/xxx", R_OK)==0) {
+ system("cat /var/tmp/xxx");
{
/* count lines - >0 -> fexists() == true */
int len, count;
FILE *f;
- f=fopen("/tmp/xxx", "r");
+ f=fopen("/var/tmp/xxx", "r");
if (f == NULL) {
warn("fopen");
return -1;
@@ -712,7 +713,7 @@
} else
printf("NO MATCH\n");
- unlink("/tmp/xxx");
+ unlink("/var/tmp/xxx");
}
/* for a given wildcard URL, find the best matching pkg */
Home |
Main Index |
Thread Index |
Old Index