int
main(int argc, char *argv[])
{
- int len;
-
#ifndef WIN32
struct passwd *pw;
#endif
* (and possibly first argument) we were called with. The lack of
* consistency here is historical.
*/
- len = strlen(argv[0]);
-
- if ((len >= 10 && strcmp(argv[0] + len - 10, "postmaster") == 0)
-#ifdef WIN32
- || (len >= 14 && strcmp(argv[0] + len - 14, "postmaster.exe") == 0)
-#endif
- )
+ if (strcmp(get_progname(argv[0]), "postmaster") == 0)
{
/* Called as "postmaster" */
exit(PostmasterMain(argc, argv));
{
char *progname;
- progname = strdup(nodir_name);
+ progname = strdup(nodir_name); /* leaks memory, but called only once */
if (progname == NULL)
{
fprintf(stderr, "%s: out of memory\n", nodir_name);