]> diplodocus.org Git - mdeliver/commitdiff
(get_filename): Restore errno before returning.
authorepg <>
Fri, 6 Sep 2002 06:29:47 +0000 (06:29 +0000)
committerepg <>
Fri, 6 Sep 2002 06:29:47 +0000 (06:29 +0000)
mdeliver.c

index 900955a..756a07c 100644 (file)
@@ -105,6 +105,12 @@ get_filename(char *fn)
 
         if (stat(fn, &statbuf) != 0) {
             if (errno == ENOENT) {
+                /* Every failure point in this program relies on errno
+                 * describing what went wrong.  This is the one
+                 * failure we *want*, so it is important to restore
+                 * errno to 0 (success) before returning.
+                 */
+                errno = 0;
                 break;
             }
         }