🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #1090

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

#1090
From: Dan Bernstein
Date: Thu, 25 Oct 1990 21:30
11 lines
955 bytes
In article <1990Oct25.075856.4923@robobar.co.uk> ronald@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
Technical Details
Message-ID: <8215:Oct2521:30:3890@kramden.acf.nyu.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!caen!ox.com!yale!cmcl2!kramden.acf.nyu.edu!brnstnd
References: <4315@pkmab.se> <1990Oct24.193712.8693@athena.mit.edu> <1990Oct25.075856.4923@robobar.co.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!caen!ox.com!yale!cmcl2!kramden.acf.nyu.edu!brnstnd
From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein)
Newsgroups: comp.unix.programmer
Subject: Re: Checking return values (was: Trojan Horses, NFS, etc.)
Message-ID: <8215:Oct2521:30:3890@kramden.acf.nyu.edu>
Date: 25 Oct 90 21:30:38 GMT
References: <4315@pkmab.se> <1990Oct24.193712.8693@athena.mit.edu> <1990Oct25.075856.4923@robobar.co.uk>
Organization: IR
Lines: 11