]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/volume.c
/tmp/log
[netatalk.git] / etc / afpd / volume.c
index c5fef8ce8ca352e2722b804e9c0ce42e452e69a0..f5ef2d5acd6547d0bdbc94015995cca2afc02ee5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.43 2002-11-15 10:59:11 srittau Exp $
+ * $Id: volume.c,v 1.46 2003-01-12 14:40:04 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -375,6 +375,8 @@ static void volset(struct vol_option *options, char *volname, int vlen,
                 options[VOLOPT_FLAGS].i_value |= AFPVOL_DROPBOX;
             else if (strcasecmp(p, "nofileid") == 0)
                 options[VOLOPT_FLAGS].i_value |= AFPVOL_NOFILEID;
+            else if (strcasecmp(p, "utf8") == 0)
+                options[VOLOPT_FLAGS].i_value |= AFPVOL_UTF8;
 
             p = strtok(NULL, ",");
         }
@@ -537,7 +539,7 @@ FILE        *fp;
     int                c;
 
     p = buf;
-    while ((( c = getc( fp )) != EOF ) && ( size > 0 )) {
+    while ((EOF != ( c = getc( fp )) ) && ( size > 0 )) {
         if ( c == '\n' || c == '\r' ) {
             *p++ = '\n';
             break;
@@ -704,7 +706,7 @@ struct passwd *pwent;
         strcat( path, p2 );
     }
 
-    if (( fp = fopen( path, "r" )) == NULL ) {
+    if (NULL == ( fp = fopen( path, "r" )) ) {
         return( -1 );
     }
 
@@ -1217,11 +1219,12 @@ int             ibuflen, *rbuflen;
     }
     /* FIXME 
     */
-    if (afp_version >= 30)
+    if (afp_version >= 30) {
         volume->max_filename = 255;
-    else 
+    }
+    else {
         volume->max_filename = MACFILELEN;
-
+    }
     if (( volume->v_flags & AFPVOL_OPEN  ) == 0 ) {
         /* FIXME unix name != mac name */
         if ((dir = dirnew(volume->v_name, volume->v_name) ) == NULL) {
@@ -1295,7 +1298,7 @@ int               ibuflen, *rbuflen;
     *rbuflen = 0;
     ibuf += 2;
     memcpy(&vid, ibuf, sizeof( vid ));
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         return( AFPERR_PARAM );
     }
 
@@ -1311,7 +1314,6 @@ int               ibuflen, *rbuflen;
             curdir = ovol->v_dir;
         }
     }
-
     dirfree( vol->v_root );
     vol->v_dir = NULL;
 #ifdef CNID_DB
@@ -1353,7 +1355,7 @@ struct extmap *getextmap(const char *path)
     char         *p;
     struct extmap *em;
 
-    if (( p = strrchr( path, '.' )) == NULL ) {
+    if (NULL == ( p = strrchr( path, '.' )) ) {
         return( defextmap );
     }
     p++;
@@ -1393,7 +1395,8 @@ AFPObj *obj;
         if ( (vol->v_flags & AFPVOL_OPEN)  && vol->v_time + 30 < tv.tv_sec) {
             if ( !stat( vol->v_path, &st ) && vol->v_time != st.st_mtime ) {
                 vol->v_time = st.st_mtime;
-                obj->attention(obj->handle, AFPATTN_NOTIFY | AFPATTN_VOLCHANGED);
+                if (!obj->attention(obj->handle, AFPATTN_NOTIFY | AFPATTN_VOLCHANGED))
+                    return -1;
                 return 1;
             }
         }
@@ -1448,7 +1451,7 @@ int               ibuflen, *rbuflen;
     memcpy(&bitmap, ibuf, sizeof( bitmap ));
     bitmap = ntohs( bitmap );
 
-    if (( vol = getvolbyvid( vid )) == NULL ) {
+    if (NULL == ( vol = getvolbyvid( vid )) ) {
         *rbuflen = 0;
         return( AFPERR_PARAM );
     }