Fossil SCM

Only #define fossil_pledge in config.h if FOSSIL_HAVE_PLEDGE is not defined so that makeheaders can pick up the function prototype for checkin.h when FOSSIL_HAVE_PLEDGE is defined.

andybradford 2018-01-15 21:43 trunk
Commit 1180676e9bd13b4d977d9c3274d7d0ece8a44e088a910073bc34fb30fe13e3a4
2 files changed +1 -3 +1 -1
+1 -3
--- src/config.h
+++ src/config.h
@@ -259,13 +259,11 @@
259259
/*
260260
** The pledge() interface is currently only available on OpenBSD 5.9
261261
** and later. Make calls to fossil_pledge() no-ops on all platforms
262262
** that omit the FOSSIL_HAVE_PLEDGE configuration parameter.
263263
*/
264
-#if defined(FOSSIL_HAVE_PLEDGE)
265
-# define fossil_pledge(A,B) fossil_pledge_impl(A,B)
266
-#else
264
+#if !defined(FOSSIL_HAVE_PLEDGE)
267265
# define fossil_pledge(A,B)
268266
#endif
269267
270268
271269
#endif /* _RC_COMPILE_ */
272270
--- src/config.h
+++ src/config.h
@@ -259,13 +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) fossil_pledge_impl(A,B)
266 #else
267 # define fossil_pledge(A,B)
268 #endif
269
270
271 #endif /* _RC_COMPILE_ */
272
--- src/config.h
+++ src/config.h
@@ -259,13 +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
+1 -1
--- src/util.c
+++ src/util.c
@@ -492,11 +492,11 @@
492492
**
493493
** There is a macro in config.h that make translates calls to
494494
** "fossil_pledge(A,B)" into calls to this routine on OpenBSD.
495495
** On all other platforms, this routine does not exist.
496496
*/
497
-void fossil_pledge_impl(const char *promises, const char *execpromises){
497
+void fossil_pledge(const char *promises, const char *execpromises){
498498
if( pledge(promises, execpromises) ){
499499
fossil_fatal("pledge(\"%s\",\"%s\") fails with errno=%d",
500500
promises, execpromises, (int)errno);
501501
}
502502
}
503503
--- src/util.c
+++ src/util.c
@@ -492,11 +492,11 @@
492 **
493 ** There is a macro in config.h that make translates calls to
494 ** "fossil_pledge(A,B)" into calls to this routine on OpenBSD.
495 ** On all other platforms, this routine does not exist.
496 */
497 void fossil_pledge_impl(const char *promises, const char *execpromises){
498 if( pledge(promises, execpromises) ){
499 fossil_fatal("pledge(\"%s\",\"%s\") fails with errno=%d",
500 promises, execpromises, (int)errno);
501 }
502 }
503
--- src/util.c
+++ src/util.c
@@ -492,11 +492,11 @@
492 **
493 ** There is a macro in config.h that make translates calls to
494 ** "fossil_pledge(A,B)" into calls to this routine on OpenBSD.
495 ** On all other platforms, this routine does not exist.
496 */
497 void fossil_pledge(const char *promises, const char *execpromises){
498 if( pledge(promises, execpromises) ){
499 fossil_fatal("pledge(\"%s\",\"%s\") fails with errno=%d",
500 promises, execpromises, (int)errno);
501 }
502 }
503

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button