From: hadaq Date: Tue, 14 Feb 2012 14:01:10 +0000 (+0000) Subject: JAM: upgraded daq_disk to check if target partition is still accessible X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=91ceeabbf1dc69ef372cae35bd73cb6b9f9a2358;p=daqdata.git JAM: upgraded daq_disk to check if target partition is still accessible First committed version, to be tested. --- diff --git a/disks/daq_disks b/disks/daq_disks index 2eeb2f3..b99e3b9 100755 Binary files a/disks/daq_disks and b/disks/daq_disks differ diff --git a/disks/disks.c b/disks/disks.c index a425781..675c187 100644 --- a/disks/disks.c +++ b/disks/disks.c @@ -5,16 +5,21 @@ #include #include #include +#include #include "shmtrans.h" #include "worker.h" -#define BUFFSIZE = 10000 +#define BUFLEN 200 +#define NUMDISKS 22 +#define NUMEBS 16 + + FILE *popen(const char *, const char *); char *strdup(const char *); -const char data[22][8] = {"/data01", "/data02", "/data03", "/data04", "/data05", +const char data[NUMDISKS][8] = {"/data01", "/data02", "/data03", "/data04", "/data05", "/data06", "/data07", "/data08", "/data09", "/data10", "/data11", "/data12", "/data13", "/data14", "/data15", "/data16", "/data17", "/data18", "/data19", "/data20", @@ -24,38 +29,45 @@ const char space[] = " "; char diskNum[] = "diskNum"; -int data_disks[22]; /* Available disk space */ +int data_disks[NUMDISKS]; /* Available disk space */ char shmemBase[] = "daq_evtbuild"; /* Base name for shared memory segments */ -int shmem_nums[16]; /* Numbers for found shared memory segments */ +int shmem_nums[NUMEBS]; /* Numbers for found shared memory segments */ int nrOfShmSegms; /* Total number of found shared memory segments */ typedef struct TheArgsS { - int excludeDisks[22]; + int excludeDisks[NUMDISKS]; int excludeDisksCnt; int sleepTime; /*seconds*/ + int testPartition; int debug; } TheArgs; static void usage(const char *progName) { - printf( "Usage: %s\n", progName); - printf( " [-h|--help] : Print this help.\n"); - printf( " [-e|--exclude ] : Nr of disk to exclude.\n"); - printf( " [-s|--sleep