Description: adding another error check.
--- a/lib/shmem.cpp
+++ b/lib/shmem.cpp
@@ -337,7 +337,10 @@
         // area to all zeros because they write beyond the old EOF. 
         // See the lseek man page for details.
         lseek(fd, size-1, SEEK_SET);
-        write(fd, "\0", 1);
+        if (1 != write(fd, "\0", 1)) {
+	    close(fd);
+	    return ERR_SHMGET;
+	}
     }
 
     *pp = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, fd, 0);
