Fossil SCM
Automatically detect the presence of the pledge() system interface and use it if it is available.
Commit
64def88f8bd8e2856a1becc1d7c014d63cc3e6a05688774ca7cf80ab0833944f
Parent
6e694cd37b7a093…
4 files changed
+1
+1
+1
-1
+2
-2
+1
| --- Makefile.in | ||
| +++ Makefile.in | ||
| @@ -36,10 +36,11 @@ | ||
| 36 | 36 | #### Tcl shell for use in running the fossil testsuite. If you do not |
| 37 | 37 | # care about testing the end result, this can be blank. |
| 38 | 38 | # |
| 39 | 39 | TCLSH = tclsh |
| 40 | 40 | |
| 41 | +CFLAGS = @CFLAGS@ | |
| 41 | 42 | LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ |
| 42 | 43 | BCCFLAGS = @CPPFLAGS@ @CFLAGS@ |
| 43 | 44 | TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H |
| 44 | 45 | INSTALLDIR = $(DESTDIR)@prefix@/bin |
| 45 | 46 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 46 | 47 |
| --- Makefile.in | |
| +++ Makefile.in | |
| @@ -36,10 +36,11 @@ | |
| 36 | #### Tcl shell for use in running the fossil testsuite. If you do not |
| 37 | # care about testing the end result, this can be blank. |
| 38 | # |
| 39 | TCLSH = tclsh |
| 40 | |
| 41 | LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ |
| 42 | BCCFLAGS = @CPPFLAGS@ @CFLAGS@ |
| 43 | TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H |
| 44 | INSTALLDIR = $(DESTDIR)@prefix@/bin |
| 45 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 46 |
| --- Makefile.in | |
| +++ Makefile.in | |
| @@ -36,10 +36,11 @@ | |
| 36 | #### Tcl shell for use in running the fossil testsuite. If you do not |
| 37 | # care about testing the end result, this can be blank. |
| 38 | # |
| 39 | TCLSH = tclsh |
| 40 | |
| 41 | CFLAGS = @CFLAGS@ |
| 42 | LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ |
| 43 | BCCFLAGS = @CPPFLAGS@ @CFLAGS@ |
| 44 | TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H |
| 45 | INSTALLDIR = $(DESTDIR)@prefix@/bin |
| 46 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 47 |
M
auto.def
+1
| --- auto.def | ||
| +++ auto.def | ||
| @@ -473,10 +473,11 @@ | ||
| 473 | 473 | } |
| 474 | 474 | } |
| 475 | 475 | cc-check-functions utime |
| 476 | 476 | cc-check-functions usleep |
| 477 | 477 | cc-check-functions strchrnul |
| 478 | +cc-check-functions pledge | |
| 478 | 479 | |
| 479 | 480 | # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE |
| 480 | 481 | if {![cc-check-functions getloadavg]} { |
| 481 | 482 | define FOSSIL_OMIT_LOAD_AVERAGE 1 |
| 482 | 483 | msg-result "Load average support unavailable" |
| 483 | 484 |
| --- auto.def | |
| +++ auto.def | |
| @@ -473,10 +473,11 @@ | |
| 473 | } |
| 474 | } |
| 475 | cc-check-functions utime |
| 476 | cc-check-functions usleep |
| 477 | cc-check-functions strchrnul |
| 478 | |
| 479 | # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE |
| 480 | if {![cc-check-functions getloadavg]} { |
| 481 | define FOSSIL_OMIT_LOAD_AVERAGE 1 |
| 482 | msg-result "Load average support unavailable" |
| 483 |
| --- auto.def | |
| +++ auto.def | |
| @@ -473,10 +473,11 @@ | |
| 473 | } |
| 474 | } |
| 475 | cc-check-functions utime |
| 476 | cc-check-functions usleep |
| 477 | cc-check-functions strchrnul |
| 478 | cc-check-functions pledge |
| 479 | |
| 480 | # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE |
| 481 | if {![cc-check-functions getloadavg]} { |
| 482 | define FOSSIL_OMIT_LOAD_AVERAGE 1 |
| 483 | msg-result "Load average support unavailable" |
| 484 |
+1
-1
| --- src/config.h | ||
| +++ src/config.h | ||
| @@ -259,11 +259,11 @@ | ||
| 259 | 259 | /* |
| 260 | 260 | ** The pledge() interface is currently only available on OpenBSD 5.9 |
| 261 | 261 | ** and later. Make calls to fossil_pledge() no-ops on all platforms |
| 262 | 262 | ** that omit the FOSSIL_HAVE_PLEDGE configuration parameter. |
| 263 | 263 | */ |
| 264 | -#if !defined(FOSSIL_HAVE_PLEDGE) | |
| 264 | +#if !defined(HAVE_PLEDGE) | |
| 265 | 265 | # define fossil_pledge(A,B) |
| 266 | 266 | #endif |
| 267 | 267 | |
| 268 | 268 | |
| 269 | 269 | #endif /* _RC_COMPILE_ */ |
| 270 | 270 |
| --- src/config.h | |
| +++ src/config.h | |
| @@ -259,11 +259,11 @@ | |
| 259 | /* |
| 260 | ** The pledge() interface is currently only available on OpenBSD 5.9 |
| 261 | ** and later. Make calls to fossil_pledge() no-ops on all platforms |
| 262 | ** that omit the FOSSIL_HAVE_PLEDGE configuration parameter. |
| 263 | */ |
| 264 | #if !defined(FOSSIL_HAVE_PLEDGE) |
| 265 | # define fossil_pledge(A,B) |
| 266 | #endif |
| 267 | |
| 268 | |
| 269 | #endif /* _RC_COMPILE_ */ |
| 270 |
| --- src/config.h | |
| +++ src/config.h | |
| @@ -259,11 +259,11 @@ | |
| 259 | /* |
| 260 | ** The pledge() interface is currently only available on OpenBSD 5.9 |
| 261 | ** and later. Make calls to fossil_pledge() no-ops on all platforms |
| 262 | ** that omit the FOSSIL_HAVE_PLEDGE configuration parameter. |
| 263 | */ |
| 264 | #if !defined(HAVE_PLEDGE) |
| 265 | # define fossil_pledge(A,B) |
| 266 | #endif |
| 267 | |
| 268 | |
| 269 | #endif /* _RC_COMPILE_ */ |
| 270 |
+2
-2
| --- src/util.c | ||
| +++ src/util.c | ||
| @@ -484,11 +484,11 @@ | ||
| 484 | 484 | setrlimit(RLIMIT_STACK, &x); |
| 485 | 485 | #endif /* defined(RLIMIT_STACK) */ |
| 486 | 486 | #endif /* defined(__unix__) */ |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | -#if defined(FOSSIL_HAVE_PLEDGE) | |
| 489 | +#if defined(HAVE_PLEDGE) | |
| 490 | 490 | /* |
| 491 | 491 | ** Interface to pledge() on OpenBSD 5.9 and later. |
| 492 | 492 | ** |
| 493 | 493 | ** On platforms that have pledge(), use this routine. |
| 494 | 494 | ** On all other platforms, this routine does not exist, but instead |
| @@ -498,6 +498,6 @@ | ||
| 498 | 498 | if( pledge(promises, execpromises) ){ |
| 499 | 499 | fossil_fatal("pledge(\"%s\",\"%s\") fails with errno=%d", |
| 500 | 500 | promises, execpromises, (int)errno); |
| 501 | 501 | } |
| 502 | 502 | } |
| 503 | -#endif /* defined(FOSSIL_HAVE_PLEDGE) */ | |
| 503 | +#endif /* defined(HAVE_PLEDGE) */ | |
| 504 | 504 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -484,11 +484,11 @@ | |
| 484 | setrlimit(RLIMIT_STACK, &x); |
| 485 | #endif /* defined(RLIMIT_STACK) */ |
| 486 | #endif /* defined(__unix__) */ |
| 487 | } |
| 488 | |
| 489 | #if defined(FOSSIL_HAVE_PLEDGE) |
| 490 | /* |
| 491 | ** Interface to pledge() on OpenBSD 5.9 and later. |
| 492 | ** |
| 493 | ** On platforms that have pledge(), use this routine. |
| 494 | ** On all other platforms, this routine does not exist, but instead |
| @@ -498,6 +498,6 @@ | |
| 498 | if( pledge(promises, execpromises) ){ |
| 499 | fossil_fatal("pledge(\"%s\",\"%s\") fails with errno=%d", |
| 500 | promises, execpromises, (int)errno); |
| 501 | } |
| 502 | } |
| 503 | #endif /* defined(FOSSIL_HAVE_PLEDGE) */ |
| 504 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -484,11 +484,11 @@ | |
| 484 | setrlimit(RLIMIT_STACK, &x); |
| 485 | #endif /* defined(RLIMIT_STACK) */ |
| 486 | #endif /* defined(__unix__) */ |
| 487 | } |
| 488 | |
| 489 | #if defined(HAVE_PLEDGE) |
| 490 | /* |
| 491 | ** Interface to pledge() on OpenBSD 5.9 and later. |
| 492 | ** |
| 493 | ** On platforms that have pledge(), use this routine. |
| 494 | ** On all other platforms, this routine does not exist, but instead |
| @@ -498,6 +498,6 @@ | |
| 498 | if( pledge(promises, execpromises) ){ |
| 499 | fossil_fatal("pledge(\"%s\",\"%s\") fails with errno=%d", |
| 500 | promises, execpromises, (int)errno); |
| 501 | } |
| 502 | } |
| 503 | #endif /* defined(HAVE_PLEDGE) */ |
| 504 |