Parcourir la source

Properly check for devices in seqreader

Suren A. Chilingaryan il y a 12 ans
Parent
commit
4341981737
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      seqreader.c

+ 1 - 1
seqreader.c

@@ -37,7 +37,7 @@ int main(int argc, char *argv[]) {
 	exit(0);
 	exit(0);
     }
     }
     
     
-    if (!strstr(argv[0], "/dev/")) {
+    if (strstr(argv[1], "/dev/")) {
 	int fd = open(argv[1], O_RDONLY|O_NOATIME|O_LARGEFILE/*|O_DIRECT*/, 0);
 	int fd = open(argv[1], O_RDONLY|O_NOATIME|O_LARGEFILE/*|O_DIRECT*/, 0);
 	if (fd < 0) {
 	if (fd < 0) {
 	    printf("Unable to open device %s\n", argv[1]);
 	    printf("Unable to open device %s\n", argv[1]);