Fossil

Check-in [1180676e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:1180676e9bd13b4d977d9c3274d7d0ece8a44e088a910073bc34fb30fe13e3a4
User & Date: andybradford 2018-01-15 21:43:36
References
2018-01-15
21:48
Update the comment for fossil_pledge to reflect the new change in [1180676e]. check-in: 8993c332 user: andybradford tags: trunk
Context
2018-01-15
21:48
Update the comment for fossil_pledge to reflect the new change in [1180676e]. check-in: 8993c332 user: andybradford tags: trunk
21:43
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. check-in: 1180676e user: andybradford tags: trunk
17:35
End comment with matching #define for new fossil_pledge_impl() routine---no functional change. check-in: cefcc87e user: andybradford tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/config.h.

257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
#define count(X) (sizeof(X)/sizeof(X[0]))

/*
** The pledge() interface is currently only available on OpenBSD 5.9
** and later.  Make calls to fossil_pledge() no-ops on all platforms
** that omit the FOSSIL_HAVE_PLEDGE configuration parameter.
*/
#if defined(FOSSIL_HAVE_PLEDGE)
# define fossil_pledge(A,B) fossil_pledge_impl(A,B)
#else
# define fossil_pledge(A,B)
#endif


#endif /* _RC_COMPILE_ */







|
<
<





257
258
259
260
261
262
263
264


265
266
267
268
269
#define count(X) (sizeof(X)/sizeof(X[0]))

/*
** The pledge() interface is currently only available on OpenBSD 5.9
** and later.  Make calls to fossil_pledge() no-ops on all platforms
** that omit the FOSSIL_HAVE_PLEDGE configuration parameter.
*/
#if !defined(FOSSIL_HAVE_PLEDGE)


# define fossil_pledge(A,B)
#endif


#endif /* _RC_COMPILE_ */

Changes to src/util.c.

490
491
492
493
494
495
496
497
498
499
500
501
502
503
/*
** Interface to pledge() on OpenBSD 5.9 and later.
**
** There is a macro in config.h that make translates calls to
** "fossil_pledge(A,B)" into calls to this routine on OpenBSD.
** On all other platforms, this routine does not exist.
*/
void fossil_pledge_impl(const char *promises, const char *execpromises){
  if( pledge(promises, execpromises) ){
    fossil_fatal("pledge(\"%s\",\"%s\") fails with errno=%d",
       promises, execpromises, (int)errno);
  }
}
#endif /* defined(FOSSIL_HAVE_PLEDGE) */







|






490
491
492
493
494
495
496
497
498
499
500
501
502
503
/*
** Interface to pledge() on OpenBSD 5.9 and later.
**
** There is a macro in config.h that make translates calls to
** "fossil_pledge(A,B)" into calls to this routine on OpenBSD.
** On all other platforms, this routine does not exist.
*/
void fossil_pledge(const char *promises, const char *execpromises){
  if( pledge(promises, execpromises) ){
    fossil_fatal("pledge(\"%s\",\"%s\") fails with errno=%d",
       promises, execpromises, (int)errno);
  }
}
#endif /* defined(FOSSIL_HAVE_PLEDGE) */