Explorar o código

Properly check for devices in seqreader

Suren A. Chilingaryan %!s(int64=12) %!d(string=hai) anos
pai
achega
4341981737
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      seqreader.c

+ 1 - 1
seqreader.c

@@ -37,7 +37,7 @@ int main(int argc, char *argv[]) {
 	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);
 	if (fd < 0) {
 	    printf("Unable to open device %s\n", argv[1]);