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);
}
#include <hadesstd.h>
/* For memcpy() */
#include <string.h>
+#include <stdio.h>
/* For read(), write(), gethostname() */
#include <unistd.h>
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);
}
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);
}
}
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);
}
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);
}
}
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;