From: hades Date: Mon, 22 May 2000 15:47:50 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=403d9faf425b71185f0b680ec27576261b5e6744;p=daqdata.git *** empty log message *** --- diff --git a/hadaq/ansiTape.c b/hadaq/ansiTape.c index 85b776a..f88780b 100644 --- a/hadaq/ansiTape.c +++ b/hadaq/ansiTape.c @@ -96,12 +96,13 @@ AnsiTape *openAnsiTape(const char* filename) { label = allocMem(80*sizeof(char)); do { stat = read(tape, label, 80); + printf("EOF Label read te get fileSeqNum:\n%s\nSo it is.\n", label); if (i == 0) { sscanf(label, "%*31c%4d", &fileSeqNum); fileSeqNum++; } i++; - } while (stat != -1); + } while (stat == 80); freeMem(label); } diff --git a/hadaq/ansiTapeLabel.c b/hadaq/ansiTapeLabel.c index c9cd1cd..2a6e78a 100644 --- a/hadaq/ansiTapeLabel.c +++ b/hadaq/ansiTapeLabel.c @@ -5,6 +5,7 @@ #include /* For memcpy() */ #include +#include /* For read(), write(), gethostname() */ #include @@ -42,7 +43,7 @@ int writeVolumeLabel(const char *vol, int tape) { v = allocMem(80*sizeof(char)); memcpy(v, vol, 80); stat = write(tape, v, 80); - if(stat == -1) { + if(stat != 80) { msglog(LOG_ERR, "Could not write volume label to tape!\n"); exit(-3); } @@ -67,7 +68,7 @@ int writeNewVolumeLabel(const char *volId, const char *ownerId, int tape) { freeMem(oid); stat = write(tape, vol, 80); - if(stat == -1) { + if(stat != 80) { msglog(LOG_ERR, "Could not write volume label to tape!\n"); exit(-3); } @@ -125,8 +126,9 @@ int writeLabel(const char *hdreof, int tape, int fileSeqNum, int bytes, const ch } stat = write(tape, label, 80); - if(stat == -1) { - msglog(LOG_ERR, "Could not write ANSI label on tape!\n"); + if(stat != 80) { + msglog(LOG_ERR, "Could not write ANSI label 1 on tape!\n"); + perror("And Why?\n"); exit(-3); } @@ -147,8 +149,8 @@ int writeLabel(const char *hdreof, int tape, int fileSeqNum, int bytes, const ch exit(-3); } stat = write(tape, label, 80); - if(stat == -1) { - msglog(LOG_ERR, "Could not write ANSI label on tape!\n"); + if(stat != 80) { + msglog(LOG_ERR, "Could not write ANSI label 2 on tape!\n"); exit(-3); } @@ -177,8 +179,8 @@ int writeLabel(const char *hdreof, int tape, int fileSeqNum, int bytes, const ch } stat = write(tape, label, 80); - if(stat == -1) { - msglog(LOG_ERR, "Could not write ANSI label on tape!\n"); + if(stat != 80) { + msglog(LOG_ERR, "Could not write ANSI label 3 on tape!\n"); exit(-3); } return 0;