]> diplodocus.org Git - mdeliver/commitdiff
(strip_from): I added a comment about my confidence in the
authorepg <>
Thu, 16 Jan 2003 20:40:57 +0000 (20:40 +0000)
committerepg <>
Thu, 16 Jan 2003 20:40:57 +0000 (20:40 +0000)
read-first-five-bytes or fail bit a long time ago, but never
committed it.

mdeliver.c

index 54884e98e35ecbc0211b68b450b3aa912bec4111..f6735971097e4456428803a0dae7d2aa3749caad 100644 (file)
@@ -153,6 +153,14 @@ strip_from(int fd, char *buf, char *fn)
 {
     ssize_t r;
 
+    /* Yes, read(2) can be interrupted and read fewer bytes than
+     * requested.  However, i'm only asking for five bytes here.  I
+     * have tested this program extensively and it handles large
+     * volumes of mail correctly every day on my systems.  This holds
+     * up my original opinion that expecting to be able to get five
+     * bytes safely is not an unreasonable demand.  If i can't get
+     * five measly bytes, something is probably wrong, so bomb.
+     */
     r = read(STDIN_FILENO, buf, 5);
     if (r != 5) {
         save_errno( unlink(fn) );