pdesr/slurm — comment on commit 9ff604a8c5c4e15659f878c7e1a6f18028515977
File: src/common/env.c line 1611
By grondo:

strtol() returns nonzero even on failure. Also, fd might be 0 if passing environment on STDIN,
though that may cause other problems with sbatch (which can also read batch script on STDIN)
Also, if fname is numeric, but fails to be a valid file descriptor, I would suggest just continuing
to process as a filename, e.g. something more like:

fd = (int)strtol(fname, &p, 10);
if (*p != '\0' || fd == LONG_MIN || fd == LONG_MAX || (fcntl (fd, F_GETFL) < 0) {
/* file descriptor was not passed, attempt to open file at fname */
fd = open(fname, O_RDONLY);
...
}

}