> > First hello to everyone, am new to this list! :)
> > 
> > Second of all when browsing through the apache code branch 1.3 I have seen a few \
> > calls to unlink(2) without actually checking the return value. I believe that 
> > these \
> > should actually be checked. Do you all agree? or do you have a valid reason why we 
> > \
> > do not check the return value? 
> > If you believe they should, just say so and I will mail in the patch(I have \
> > produced it already).
>
> maybe you should just post the patch so we can see the context of the
> unlink(); it is possible that there is no sense in checking the return
> code from unlink() since there is nothing to be done about it anyway;
> it is possible that there is no sense in checking the return code from
> unlink() since we' aren't guaranteed that the file exists; depends on
> the context

Here is an example of what I am on about. Even if we do not do anything
we should still alert the user(I believe).

--- http_main.c.orig    2004-09-30 18:12:00.000000000 +0000
+++ http_main.c 2004-09-30 19:01:19.000000000 +0000
@@ -900,7 +900,10 @@
        fprintf(stderr, "Cannot open lock file: %s\n", ap_lock_fname);
        exit(APEXIT_INIT);
     }
-    unlink(ap_lock_fname);
+    if (unlink(ap_lock_fname) == -1) {
+       perror("unlink");
+       fprintf(stderr, "Cannot remove lock file: %s\n", ap_lock_fname);        
+    }
 }
 
 static void accept_mutex_on_fcntl(void)

If this is wrong, please let me know. I have not fully
read the apache code.

Thanks,

-- 
-Liam J. Foy
http://liamfoy.kerneled.org

Reply via email to