Преглед на файлове

Add comments telling why we use tempnam() and tmpnam().

Adam Heath преди 25 години
родител
ревизия
ecb9054f73
променени са 3 файла, в които са добавени 7 реда и са изтрити 0 реда
  1. 5 0
      ChangeLog
  2. 1 0
      dpkg-deb/info.c
  3. 1 0
      main/processarc.c

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+Mon Apr 23 02:17:26 CDT 2001 Adam Heath <doogie@debian.org>
+
+  * dpkg-deb/info.c, main/processarc.c: Add comments telling why we
+    use tempnam() and tmpnam().
+
 Sun Apr 22 23:59:00 CDT 2001 Adam Heath <doogie@debian.org>
 
   * archtable: Added alphaev67-linux-gnu.

+ 1 - 0
dpkg-deb/info.c

@@ -64,6 +64,7 @@ static void info_prepare(const char *const **argvp,
   
   *debarp= *(*argvp)++;
   if (!*debarp) badusage(_("--%s needs a .deb filename argument"),cipaction->olong);
+  /* This created a temporary directory, so ignore the warning. */
   if ((dbuf= tempnam(NULL,"dpkg")) == NULL)
     ohshite(_("failed to make temporary filename"));
   *directoryp= dbuf;

+ 1 - 0
main/processarc.c

@@ -162,6 +162,7 @@ void process_archive(const char *filename) {
 
   if (f_noact) {
     cidir= cidirtmpnambuf;
+    /* We use tmpnam here, not to get a unique filename, but to get a unique directory. */
     if (!tmpnam(cidir)) ohshite(_("unable to get unique filename for control info"));
     strcat(cidir,"/");
   } else {