Checking return values (was: Trojan Horses, NFS, etc.)

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Fri Oct 26 07:30:38 AEST 1990


In article <1990Oct25.075856.4923 at robobar.co.uk> ronald at robobar.co.uk (Ronald S H Khoo) writes:
> 	perror(name);
> 	fprintf(stderr, "%s: error opening %s (see error message above)\n",
> 		progname, name);

Correct but ugly. As long as you have an array sys_errlist[] with the
messages, you can just copy errno into a variable and use that. To skip
coding most of the common idioms you might snarf err.c from the pty
package.

---Dan



More information about the Comp.unix.programmer mailing list