From: H. Peter Anvin Date: Tue, 11 Oct 2005 16:11:11 GMT Subject: Re: [RFC] Cleaning up die() error messages Message-ID: <434BE41F.4060909@zytor.com> In-Reply-To: <81b0412b0510110802lbcdebe0m17bce7ca81ea76d2@mail.gmail.com> Alex Riesen wrote: > On 10/10/05, Elfyn McBratney wrote: > >> int main (int argc, char **argv) >> { >> set_prog_name(argv[0]); > > > I'd also use readlink on /proc/self/exe by default (if set_prog_name > _not_ called). > It simplifies the code at least on linux, and makes possible very slow > transition for other platforms. So you don't have to update each and > every .c file containing "main[[:space:]]*(" ;) It's really better just to put the stuff at the beginning of each main. If that's too annoying, librarize main and rename your mains "git_main". -hpa