=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/midicat/midicat.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** src/usr.bin/midicat/midicat.c 2018/11/30 07:08:24 1.1 --- src/usr.bin/midicat/midicat.c 2019/06/28 13:35:02 1.2 *************** *** 98,104 **** ifd = STDIN_FILENO; else { ifd = open(ifile, O_RDONLY, 0); ! if (ifd < 0) { perror(ifile); return 1; } --- 98,104 ---- ifd = STDIN_FILENO; else { ifd = open(ifile, O_RDONLY, 0); ! if (ifd == -1) { perror(ifile); return 1; } *************** *** 108,114 **** ofd = STDOUT_FILENO; else { ofd = open(ofile, O_WRONLY | O_CREAT | O_TRUNC, 0666); ! if (ofd < 0) { perror(ofile); return 1; } --- 108,114 ---- ofd = STDOUT_FILENO; else { ofd = open(ofile, O_WRONLY | O_CREAT | O_TRUNC, 0666); ! if (ofd == -1) { perror(ofile); return 1; } *************** *** 141,147 **** } } ! if (pledge("stdio", NULL) < 0) err(1, "pledge"); /* transfer until end-of-file or error */ --- 141,147 ---- } } ! if (pledge("stdio", NULL) == -1) err(1, "pledge"); /* transfer until end-of-file or error */ *************** *** 150,156 **** len = read(ifd, buf, sizeof(buf)); if (len == 0) break; ! if (len < 0) { perror("stdin"); break; } --- 150,156 ---- len = read(ifd, buf, sizeof(buf)); if (len == 0) break; ! if (len == -1) { perror("stdin"); break; }