]> arthur.barton.de Git - netatalk.git/commitdiff
setvoltime modified for concurrent multiuser update of volumes
authorrdschulz <rdschulz>
Fri, 22 Sep 2000 12:58:15 +0000 (12:58 +0000)
committerrdschulz <rdschulz>
Fri, 22 Sep 2000 12:58:15 +0000 (12:58 +0000)
etc/afpd/volume.c

index fc09f98cd07a510de0667ee46e815a11d9068bd7..567d2d71f4614ef3e912a016600f5bc727acf44c 100644 (file)
@@ -1199,11 +1199,21 @@ void setvoltime(obj, vol )
 {
     struct timeval     tv;
 
-    /* fail w/out dying */
+    /* just looking at vol->v_time is broken seriously since updates
+     * from other users afpd processes never are seen.
+     * This is not the most elegant solution (a shared memory between
+     * the afpd processes would come closer)
+     * [RS] */
+
     if ( gettimeofday( &tv, 0 ) < 0 ) {
        syslog( LOG_ERR, "setvoltime: gettimeofday: %m" );
        return;
     }
+    if( utime( vol->v_path, NULL ) < 0 ) {
+        /* write of time failed ... probably a read only filesys,
+         * where no other users can interfere, so there's no issue here
+         */
+    }
     
     /* a little granularity */
     if (vol->v_time < tv.tv_sec) {