dj(1): remove unnecessary stderr checks

This commit is contained in:
dtb 2024-07-03 15:47:48 -06:00
parent 3897f44cf8
commit 66ca4b9a12
Signed by: trinity
GPG Key ID: 34C0543BBB6AF81B

View File

@ -59,11 +59,8 @@ static int write_flags = O_WRONLY | O_CREAT;
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
/* Macro to check if fd is a std* file, e.g. stdin. */
#define fdisstd(fd) \
((fd) == STDIN_FILENO \
|| (fd) == STDOUT_FILENO \
|| (fd) == STDERR_FILENO)
/* Macro to check if fd is stdin or stdout */
#define fdisstd(fd) ((fd) == STDIN_FILENO || (fd) == STDOUT_FILENO)
/* Fills the unused portion of io's buffer with padding, updating io->bufuse.
* Returns io. */
@ -142,7 +139,6 @@ Io_fdseek(struct Io *io){
assert(io != NULL);
assert(io->fd != STDIN_FILENO || io->fl == read_flags);
assert(io->fd != STDOUT_FILENO || io->fl == write_flags);
assert(io->fd != STDERR_FILENO || io->fl == write_flags);
if(io->seek == 0
|| (!fdisstd(io->fd) && lseek(io->fd, io->seek, SEEK_SET) != -1)){