]> arthur.barton.de Git - netatalk.git/commitdiff
remove or mark as ok more gcc warnings.
authordidg <didg>
Mon, 31 Jan 2005 17:00:38 +0000 (17:00 +0000)
committerdidg <didg>
Mon, 31 Jan 2005 17:00:38 +0000 (17:00 +0000)
15 files changed:
etc/afpd/afp_config.c
etc/afpd/auth.c
etc/afpd/directory.c
etc/afpd/file.c
etc/afpd/nfsquota.c
etc/afpd/quota.c
etc/afpd/unix.h
etc/atalkd/config.c
etc/atalkd/main.c
etc/cnid_dbd/main.c
etc/papd/ppd.c
etc/papd/session.c
libatalk/atp/atp_sresp.c
libatalk/cnid/cnid.c
libatalk/cnid/tdb/cnid_tdb_add.c

index 606068a72dea27954f9b01432455ac6e6cb81b2f..28ffd514c345e2d181a830971c38109d2eaef283 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_config.c,v 1.22.6.9.2.1 2005-01-03 15:24:05 didg Exp $
+ * $Id: afp_config.c,v 1.22.6.9.2.2 2005-01-31 17:00:38 didg Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
@@ -535,7 +535,7 @@ AFPConfig *configinit(struct afp_options *cmdline)
     FILE *fp;
     char buf[LINESIZE + 1], *p, have_option = 0;
     struct afp_options options;
-    AFPConfig *config, *first = NULL;
+    AFPConfig *config, *first = NULL; /* uninitialized, OK 310105 */
 
     status_reset();
     /* if config file doesn't exist, load defaults */
index 2470133202a2ab5ae8ae917f996a22dc9c5391e4..254db6f408d9e9317090c420aa1c07fe9d7adf4f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: auth.c,v 1.44.2.3.2.15.2.1 2005-01-11 20:58:42 didg Exp $
+ * $Id: auth.c,v 1.44.2.3.2.15.2.2 2005-01-31 17:00:41 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -444,7 +444,7 @@ unsigned int ibuflen, *rbuflen;
     u_int32_t           idlen = 0;
     u_int32_t          boottime;
     u_int32_t           tklen, tp;
-    char                *token;
+    char                *token; 
     char                *p;
 
     *rbuflen = 0;
@@ -503,7 +503,6 @@ unsigned int ibuflen, *rbuflen;
            tklen = obj->sinfo.sessiontoken_len;
            token = obj->sinfo.sessiontoken;
        }
-       type = 0;
        break;
      case 8: /* Panther Kerberos Token */
             tklen = obj->sinfo.cryptedkey_len;
index 80050643077a7d26ec7b1242e78fb6915e71a9cc..dc2dd3e71dbc41c5245b70642543cec084cbfea8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.71.2.4.2.15.2.3 2004-12-07 03:23:48 didg Exp $
+ * $Id: directory.c,v 1.71.2.4.2.15.2.4 2005-01-31 17:00:43 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1650,7 +1650,7 @@ int setdirparams(const struct vol *vol,
     u_int16_t           bitmap = d_bitmap;
     u_char              finder_buf[32];
     u_int32_t          upriv;
-    mode_t              mpriv;
+    mode_t              mpriv;          /* uninitialized, OK 310105 */
     u_int16_t           upriv_bit = 0;
 
     bit = 0;
index be4b74fc16dfde198d57c686ff8fb2002171f4c4..855f92e37b5ef92facc0226582cff1e853777fa9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: file.c,v 1.92.2.2.2.31.2.7 2005-01-30 20:56:20 didg Exp $
+ * $Id: file.c,v 1.92.2.2.2.31.2.8 2005-01-31 17:00:55 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -781,7 +781,7 @@ int setfilparams(struct vol *vol,
     struct extmap      *em;
     int                        bit, isad = 1, err = AFP_OK;
     char                *upath;
-    u_char              achar, *fdType, xyy[4];
+    u_char              achar, *fdType, xyy[4]; /* uninitialized, OK 310105 */
     u_int16_t          ashort, bshort;
     u_int32_t          aint;
     u_int32_t          upriv;
index 2b4b30d01689b117959aad7fa58a2a9b21687d53..eaae0f35580b3e173d4c45de96a37d1429b24080 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: nfsquota.c,v 1.10.8.3 2004-05-12 21:21:48 didg Exp $
+ * $Id: nfsquota.c,v 1.10.8.3.2.1 2005-01-31 17:00:59 didg Exp $
  *
  * parts of this are lifted from the bsd quota program and are
  * therefore under the following copyright:
@@ -105,7 +105,7 @@ char *in, *out;
 #define GQR_RQUOTA getquota_rslt_u.gqr_rquota
 #endif /* USE_OLD_RQUOTA */
 
-int getnfsquota(const struct vol *vol, const int uid, const u_int32_t bsize,
+int getnfsquota(struct vol *vol, const int uid, const u_int32_t bsize,
                 struct dqblk *dqp)
 {
 
index 59bc3a8597c7d56b9a3e6ce29bf9849b6408394a..79ece392ec37eff0c51b4602ff4c4cc9958aed71 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: quota.c,v 1.22.8.11 2004-06-28 22:46:28 didg Exp $
+ * $Id: quota.c,v 1.22.8.11.2.1 2005-01-31 17:01:00 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -695,7 +695,7 @@ struct dqblk          *dqblk;
 #endif
 
 int uquota_getvolspace( vol, bfree, btotal, bsize)
-const struct vol       *vol;
+struct vol     *vol;
 VolSpace       *bfree, *btotal;
 const u_int32_t bsize;
 {
index 370045d137d65c7440e02b407d417cf884476452..80ed80bd136d6a0eaae7d0293d7b84f15a8cee49 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: unix.h,v 1.12.2.1.2.6 2004-05-10 18:40:33 didg Exp $
+ * $Id: unix.h,v 1.12.2.1.2.6.2.1 2005-01-31 17:01:00 didg Exp $
  */
 
 #ifndef AFPD_UNIX_H
@@ -206,10 +206,10 @@ extern long quotactl __P ((unsigned int, const char *, int, caddr_t));
 
 #endif /* linux */
 
-extern int getnfsquota __P((const struct vol *, const int, const u_int32_t,
+extern int getnfsquota __P((struct vol *, const int, const u_int32_t,
                                 struct dqblk *));
 
-extern int uquota_getvolspace __P((const struct vol *, VolSpace *, VolSpace *,
+extern int uquota_getvolspace __P((struct vol *, VolSpace *, VolSpace *,
                                        const u_int32_t));
 #endif /* NO_QUOTA_SUPPORT */
 
index c67573c8133ee0268b17568e58e48a53bdfd92a8..f43200cffac9644ea572869f399e206ec5fadb45 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: config.c,v 1.13.6.5 2004-06-09 01:10:07 bfernhomberg Exp $
+ * $Id: config.c,v 1.13.6.5.2.1 2005-01-31 17:01:01 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -69,7 +69,7 @@ char *strchr (), *strrchr ();
 
 int    router(), dontroute(), seed(), phase(), net(), addr(), zone(), noallmulti();
 
-static struct param {
+static const struct param {
     char       *p_name;
     int                (*p_func)();
 } params[] = {
index 7f7ba6b5091a3f1773a3ef18b2d6e4b4b1f0c812..f43fb5e55359f5e53dc3a8640323964c417fe69c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.c,v 1.17.8.6 2004-05-12 21:21:48 didg Exp $
+ * $Id: main.c,v 1.17.8.6.2.1 2005-01-31 17:01:04 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -867,14 +867,15 @@ int main( ac, av )
     struct sockaddr_at sat;
     struct sigaction   sv;
     struct itimerval   it;
+    sigset_t            signal_set, old_set;
+    
     struct interface   *iface;
     int                        status;
     struct atport      *ap;
     fd_set             readfds;
-    int                        i, mask, c;
+    int                        i, c;
     SOCKLEN_T          fromlen;
     char               *prog;
-;
 
     while (( c = getopt( ac, av, "12qsdtf:P:v" )) != EOF ) {
        switch ( c ) {
@@ -1167,6 +1168,14 @@ int main( ac, av )
        atalkd_exit( 1 );
     }
 
+    sigemptyset( &signal_set );
+    sigaddset(&signal_set, SIGALRM);
+#if 0
+    /* don't block SIGTERM */
+    sigaddset(&signal_set, SIGTERM);
+#endif
+    sigaddset(&signal_set, SIGUSR1);
+
     for (;;) {
        readfds = fds;
        if ( select( nfds, &readfds, NULL, NULL, NULL) < 0 ) {
@@ -1197,16 +1206,12 @@ int main( ac, av )
                                    iface->i_flags, ap->ap_port, ap->ap_fd );
                            bprint( Packet, c );
                        }
-#endif /* DEBUG */
-#ifdef __svr4__
-                       if ( sighold( SIGALRM ) || sighold( SIGUSR1 )) {
-                           LOG(log_error, logtype_atalkd, "sighold: %s", strerror(errno) );
+#endif 
+                       if (sigprocmask(SIG_BLOCK, &signal_set, &old_set) < 0) {
+                           LOG(log_error, logtype_atalkd, "sigprocmask: %s", strerror(errno) );
                            atalkd_exit( 1 );
                        }
-#else /* __svr4__ */
-                       mask = sigsetmask( sigmask( SIGALRM ) |
-                               sigmask( SIGUSR1 ));
-#endif /* __svr4__ */
+
                        if (( *ap->ap_packet )( ap, &sat, Packet, c ) < 0) {
                          LOG(log_error, logtype_atalkd, "ap->ap_packet: %s", strerror(errno));
                          atalkd_exit(1);
@@ -1214,15 +1219,12 @@ int main( ac, av )
 
 #ifdef DEBUG
                        consistency();
-#endif /* DEBUG */
-#ifdef __svr4__
-                       if ( sigrelse( SIGUSR1 ) || sigrelse( SIGALRM )) {
-                           LOG(log_error, logtype_atalkd, "sigrelse: %s", strerror(errno) );
+#endif 
+                       if (sigprocmask(SIG_SETMASK, &old_set, NULL) < 0) {
+                           LOG(log_error, logtype_atalkd, "sigprocmask old set: %s", strerror(errno) );
                            atalkd_exit( 1 );
                        }
-#else /* __svr4__ */
-                       sigsetmask( mask );
-#endif /* __svr4__ */
+
                    }
                }
            }
index e45adb076d9de1b462b02a6929a1de5202ccb56e..cb2eb30aa5b6a6dac357c77b236e0c97b20baf3f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.c,v 1.1.4.10.2.2 2004-12-21 13:36:12 didg Exp $
+ * $Id: main.c,v 1.1.4.10.2.3 2005-01-31 17:01:05 didg Exp $
  *
  * Copyright (C) Joerg Lenneis 2003
  * All Rights Reserved.  See COPYING.
@@ -167,6 +167,7 @@ static int loop(struct db_param *dbp)
             break;
         default:
             LOG(log_error, logtype_cnid, "loop: unknow op %d", rqst.op);
+            ret = -1;
             break;
         }       
 
index eeb604031d3e0b4e44040f490641942452296ad5..5d2aa5d70190b945f55cadd719129473e57bee40 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ppd.c,v 1.9.8.1 2004-06-09 01:25:54 bfernhomberg Exp $
+ * $Id: ppd.c,v 1.9.8.1.2.1 2005-01-31 17:01:07 didg Exp $
  *
  * Copyright (c) 1995 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -71,7 +71,7 @@ static char* my_fgets(buf, bufsize, stream)
     size_t bufsize;
     FILE   *stream;
 {
-    char p;
+    char p;           /* uninitialized, OK 310105 */
     size_t count = 0;
  
     while (count < bufsize && EOF != (p=fgetc(stream))) {
index 7f563bff18cfadca31290614d020db1e7feca892..1f9f3a9ac62bf46292136b08edce4b4521b5e378 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: session.c,v 1.14.8.1 2004-02-07 19:46:08 didg Exp $
+ * $Id: session.c,v 1.14.8.1.2.1 2005-01-31 17:01:07 didg Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -74,7 +74,7 @@ int session( atp, sat )
     char               cbuf[ 578 ];
     int                        i, cc, timeout = 0, readpending = 0;
     u_int16_t          seq = 0, rseq = 1, netseq;
-    u_char             readport;
+    u_char             readport; /* uninitialized, OK 310105 */
 
     infile.pf_state = PF_BOT;
     infile.pf_bufsize = 0;
index 57c5281e828ec7bbf5624ae1919ef617e940f218..36e230d681bcaa008e7aa6516379f965b618d83f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: atp_sresp.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ * $Id: atp_sresp.c,v 1.4.16.1 2005-01-31 17:01:14 didg Exp $
  *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
@@ -53,7 +53,7 @@ int atp_sresp( ah, atpb )
     int                        i;
     u_int8_t           ctrlinfo;
     struct atpbuf      *resp_buf;
-    struct atpbuf      *save_buf;
+    struct atpbuf      *save_buf; /* uninitialized, OK 310105 */
 
 #ifdef EBUG
     atp_print_bufuse( ah, "atp_sresp" );
index dc6bef784ace911eedaf72e09c1f8cc638199222..ede99c8978cfdcbe75eb8ca611f92b626ac58127 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: cnid.c,v 1.1.4.11.2.1 2005-01-30 20:56:22 didg Exp $
+ * $Id: cnid.c,v 1.1.4.11.2.2 2005-01-31 17:01:16 didg Exp $
  *
  * Copyright (c) 2003 the Netatalk Team
  * Copyright (c) 2003 Rafal Lewczuk <rlewczuk@pronet.pl>
@@ -98,7 +98,7 @@ struct _cnid_db *cnid_open(const char *volpath, mode_t mask, char *type, int fla
     struct _cnid_db *db;
     cnid_module *mod = NULL;
     struct list_head *ptr;
-    uid_t uid;
+    uid_t uid;  /* uninitialized, OK 310105 */
     gid_t gid;
     
     list_for_each(ptr, &modules) {
index 223fbc17e69a9779e4e793b01163e25b9f47a43d..5796e33ed15a147f0f6522edf673116a2fa1d118 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cnid_tdb_add.c,v 1.1.2.1.2.1 2005-01-30 20:56:23 didg Exp $
+ * $Id: cnid_tdb_add.c,v 1.1.2.1.2.2 2005-01-31 17:01:16 didg Exp $
  *
  * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved. See COPYRIGHT.
@@ -24,7 +24,6 @@
 
 static int add_cnid (struct _cnid_tdb_private *db, TDB_DATA *key, TDB_DATA *data) {
     TDB_DATA altkey, altdata;
-    int rc;
 
     memset(&altkey, 0, sizeof(altkey));
     memset(&altdata, 0, sizeof(altdata));
@@ -53,7 +52,7 @@ static int add_cnid (struct _cnid_tdb_private *db, TDB_DATA *key, TDB_DATA *data
     return 0;
 
 abort:
-    return rc;
+    return -1;
 }
 
 /* ----------------------- */