浏览代码

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>
 Sun Apr 22 23:59:00 CDT 2001 Adam Heath <doogie@debian.org>
 
 
   * archtable: Added alphaev67-linux-gnu.
   * 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)++;
   *debarp= *(*argvp)++;
   if (!*debarp) badusage(_("--%s needs a .deb filename argument"),cipaction->olong);
   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)
   if ((dbuf= tempnam(NULL,"dpkg")) == NULL)
     ohshite(_("failed to make temporary filename"));
     ohshite(_("failed to make temporary filename"));
   *directoryp= dbuf;
   *directoryp= dbuf;

+ 1 - 0
main/processarc.c

@@ -162,6 +162,7 @@ void process_archive(const char *filename) {
 
 
   if (f_noact) {
   if (f_noact) {
     cidir= cidirtmpnambuf;
     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"));
     if (!tmpnam(cidir)) ohshite(_("unable to get unique filename for control info"));
     strcat(cidir,"/");
     strcat(cidir,"/");
   } else {
   } else {