From: Ralph Boehme Date: Thu, 27 Dec 2012 11:45:22 +0000 (+0100) Subject: Several fixes X-Git-Url: https://arthur.barton.de/gitweb/?p=netatalk.git;a=commitdiff_plain;h=cbb01a0e4a5474a70936f32e3231bb6336b31998 Several fixes Allow the usage of -r option. Fix flags argument to cnid_open(). Update usage. --- diff --git a/etc/cnid_dbd/cmd_dbd.c b/etc/cnid_dbd/cmd_dbd.c index 8a12bfad..31d74e6c 100644 --- a/etc/cnid_dbd/cmd_dbd.c +++ b/etc/cnid_dbd/cmd_dbd.c @@ -92,13 +92,14 @@ static void set_signal(void) static void usage (void) { - printf("Usage: dbd [-cfFstvV] \n" - "dbd scans or reindex Netatalk CNID databases of AFP volumes.\n" - "dbd must be run with appropiate permissions i.e. as root.\n" - "By default dbd rebuilds the CNID database of the volume.\n\n" + printf("Usage: dbd [-cfFstvV] \n\n" + "dbd scans all file and directories of AFP volumes, updating the\n" + "CNID database of the volume. dbd must be run with appropiate\n" + "permissions i.e. as root.\n\n" "Options:\n" - " -s Scan volume:\n" - " -c convert from adouble:v2 to adouble:ea (use with -r)\n" + " -s scan volume: treat the volume as read only and don't\n" + " perform any filesystem modifications\n" + " -c convert from adouble:v2 to adouble:ea\n" " -F location of the afp.conf config file\n" " -f delete and recreate CNID database\n" " -t show statistics while running\n" @@ -137,7 +138,7 @@ int main(int argc, char **argv) const char *volpath = NULL; int c; - while ((c = getopt(argc, argv, ":cfF:stvV")) != -1) { + while ((c = getopt(argc, argv, ":cfF:rstvV")) != -1) { switch(c) { case 'c': flags |= DBD_FLAGS_V2TOEA; @@ -148,6 +149,9 @@ int main(int argc, char **argv) case 'F': obj.cmdlineconfigfile = strdup(optarg); break; + case 'r': + /* the default */ + break; case 's': dbd_cmd = dbd_scan; flags |= DBD_FLAGS_SCAN; @@ -231,7 +235,7 @@ int main(int argc, char **argv) if ((vol->v_cdb = cnid_open(vol->v_path, 0000, "dbd", - flags, + vol->v_flags & AFPVOL_NODEV ? CNID_FLAG_NODEV : 0, vol->v_cnidserver, vol->v_cnidport)) == NULL) { dbd_log(LOGSTD, "Cant initialize CNID database connection for %s", vol->v_path);