+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these librararies and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
/* $TOG: svcmain.c /main/10 1998/04/06 13:13:49 mgreess $ */
/*
* (c) Copyright 1993, 1994 Hewlett-Packard Company
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
*/
+#if defined(linux)
+#define _POSIX_C_SOURCE 2
+#endif
+
#include <EUSCompat.h>
#include <stdio.h>
#include <errno.h>
}
minute = atoi(×tr[len - 2]);
- timestr[len - 2] = NULL;
+ timestr[len - 2] = '\0';
hour = atoi(timestr);
if (hour > 23 || minute > 59)
}
/* Change current directory, so core file can be dumped. */
- chdir (dir);
+ if(-1 == chdir (dir)) {
+ perror(strerror(errno));
+ }
}
/*
if (udp_transp == (SVCXPRT *)-1) {
udp_transp = svcudp_create(standalone ? RPC_ANYSOCK : 0
-#if defined(_AIX) || defined(hpV4) || defined(__osf__) || defined(linux)
+#if defined(_AIX) || defined(hpV4) || defined(__osf__) || defined(linux) || \
+ defined(CSRG_BASED)
);
#else
,0,0);
setgid (daemon_gid);
setuid (daemon_uid);
#else
- setegid (daemon_gid);
- seteuid (daemon_uid);
+ if(-1 == setegid (daemon_gid)) {
+ perror(strerror(errno));
+ }
+ if(-1 == seteuid (daemon_uid)) {
+ perror(strerror(errno));
+ }
#endif /* HPUX */
#endif /* AIX */