Fix POSIX compliance

* "WAIT_MYPGRP" isn't POSIX'ish. Relying on this caused compilation
  issues in certain environments (e.g. under Cygwin). As a workaround,
  define "WAIT_MYPGRP" explicitly if it's undefined.

* "P_tmpdir" is an XSI extension. Don't try use it if it isn't
  available.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2012-02-19 01:39:07 +01:00
parent 8892bb3625
commit 136e5bc4f7
2 changed files with 6 additions and 0 deletions

View File

@ -43,6 +43,10 @@
#include "calcurse.h" #include "calcurse.h"
#ifndef WAIT_MYPGRP
#define WAIT_MYPGRP 0
#endif
/* /*
* General signal handling routine. * General signal handling routine.
* Catch return values from children (user-defined notification commands). * Catch return values from children (user-defined notification commands).

View File

@ -523,8 +523,10 @@ get_tempdir (void)
{ {
if (getenv ("TMPDIR")) if (getenv ("TMPDIR"))
return getenv ("TMPDIR"); return getenv ("TMPDIR");
#ifdef P_tmpdir
else if (P_tmpdir) else if (P_tmpdir)
return P_tmpdir; return P_tmpdir;
#endif
else else
return "/tmp"; return "/tmp";
} }