Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/dev_mkdb We use rename() to produce the dev.db file...



details:   https://anonhg.NetBSD.org/src/rev/be873bf136c6
branches:  trunk
changeset: 512278:be873bf136c6
user:      manu <manu%NetBSD.org@localhost>
date:      Sun Jul 08 20:01:43 2001 +0000

description:
We use rename() to produce the dev.db file, and rename() is not able to move
files across filesystems. Hence we use /var/run for dev.tmp, since dev.db
will be in /var/run.

diffstat:

 usr.sbin/dev_mkdb/dev_mkdb.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 5d181d63b72f -r be873bf136c6 usr.sbin/dev_mkdb/dev_mkdb.c
--- a/usr.sbin/dev_mkdb/dev_mkdb.c      Sun Jul 08 19:58:02 2001 +0000
+++ b/usr.sbin/dev_mkdb/dev_mkdb.c      Sun Jul 08 20:01:43 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dev_mkdb.c,v 1.12 2001/07/05 20:35:33 manu Exp $       */
+/*     $NetBSD: dev_mkdb.c,v 1.13 2001/07/08 20:01:43 manu Exp $       */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "from: @(#)dev_mkdb.c   8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: dev_mkdb.c,v 1.12 2001/07/05 20:35:33 manu Exp $");
+__RCSID("$NetBSD: dev_mkdb.c,v 1.13 2001/07/08 20:01:43 manu Exp $");
 #endif
 #endif /* not lint */
 
@@ -120,7 +120,12 @@
        if (ftsp == NULL)
                err(1, "fts_open: %s", path_dev);
 
-       (void)snprintf(dbtmp, MAXPATHLEN, "%sdev.tmp", _PATH_TMP);
+       /* 
+        * We use rename() to produce the dev.db file, and rename() 
+        * is not able to move files across filesystems. Hence we use
+        * /var/run for dev.tmp, since dev.db will be in /var/run.
+        */
+       (void)snprintf(dbtmp, MAXPATHLEN, "%sdev.tmp", _PATH_VARRUN);
        if (dbname_arg)
                strncpy(dbname, dbname_arg, MAXPATHLEN);
        else



Home | Main Index | Thread Index | Old Index