Skip to content

Commit

Permalink
Correct compilation error reported by nvidia/24.1
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosbento committed Mar 26, 2024
1 parent bd1000e commit 65b3b70
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tools/ecflow_standalone.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ char *nameof(char *name) {
return s;
}

pid_t do_setsid(void) {
#if defined(linux) || defined(__APPLE__) || defined(__MACH__) || defined(hpux) || defined(solaris) || defined(SGI) || \
defined(SVR4) || defined(AIX) || defined(SYG) || defined(alpha) || defined(__NVCOMPILER)
return setsid();
#else
return setsid(0);
#endif
}

int main(int argc, char** argv)
{
char *infile = NULL; /* Temporary input file */
Expand Down Expand Up @@ -183,11 +192,7 @@ int main(int argc, char** argv)
for (n=3; n<65535 ;n++) fclose(n); */

/* create a new session from the child process */
#if defined(linux) || defined(__APPLE__) || defined(__MACH__) || defined(hpux) || defined(solaris) || defined(SGI) || defined(SVR4) || defined(AIX) || defined(SYG) || defined(alpha)
if( setsid() == -1 )
#else
if( setsid(0) == -1 )
#endif
if( do_setsid() == -1 )
{
perror("STANDALONE-SETSID");
exit(1);
Expand Down

0 comments on commit 65b3b70

Please sign in to comment.