]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
*** empty log message ***
authorhades <hades>
Mon, 22 May 2000 15:47:50 +0000 (15:47 +0000)
committerhades <hades>
Mon, 22 May 2000 15:47:50 +0000 (15:47 +0000)
hadaq/ansiTape.c
hadaq/ansiTapeLabel.c

index 85b776ab7528b7df8fed1a9f2b89391dd62bdfb7..f88780b21e3782859c8b2a4408ea9a35222e1392 100644 (file)
@@ -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);
        }
 
index c9cd1cd859e358ac752adc37878e77a2332c4ca2..2a6e78ab6ef7d87903c0eb7107130827f43831ad 100644 (file)
@@ -5,6 +5,7 @@
 #include <hadesstd.h>
 /* For memcpy() */
 #include <string.h>
+#include <stdio.h>
 
 /* For read(), write(), gethostname() */
 #include <unistd.h>
@@ -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 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 on tape!\n");
                exit(-3);
        }
        return 0;