Skip to content

Commit 65b3b70

Browse files
committed
Correct compilation error reported by nvidia/24.1
1 parent bd1000e commit 65b3b70

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tools/ecflow_standalone.c

+10-5
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ char *nameof(char *name) {
8484
return s;
8585
}
8686

87+
pid_t do_setsid(void) {
88+
#if defined(linux) || defined(__APPLE__) || defined(__MACH__) || defined(hpux) || defined(solaris) || defined(SGI) || \
89+
defined(SVR4) || defined(AIX) || defined(SYG) || defined(alpha) || defined(__NVCOMPILER)
90+
return setsid();
91+
#else
92+
return setsid(0);
93+
#endif
94+
}
95+
8796
int main(int argc, char** argv)
8897
{
8998
char *infile = NULL; /* Temporary input file */
@@ -183,11 +192,7 @@ int main(int argc, char** argv)
183192
for (n=3; n<65535 ;n++) fclose(n); */
184193

185194
/* create a new session from the child process */
186-
#if defined(linux) || defined(__APPLE__) || defined(__MACH__) || defined(hpux) || defined(solaris) || defined(SGI) || defined(SVR4) || defined(AIX) || defined(SYG) || defined(alpha)
187-
if( setsid() == -1 )
188-
#else
189-
if( setsid(0) == -1 )
190-
#endif
195+
if( do_setsid() == -1 )
191196
{
192197
perror("STANDALONE-SETSID");
193198
exit(1);

0 commit comments

Comments
 (0)