Skip to content

Commit

Permalink
security/snoopy: Fix build on 14-CURRENT
Browse files Browse the repository at this point in the history
tid.c:52:23: error: incompatible pointer to integer conversion initializing 'unsigned long' with an expression of type 'pthread_t' (aka 'struct pthread *') [-Wint-conversion]
    long unsigned int tid = pthread_self();
                      ^     ~~~~~~~~~~~~~~
1 error generated.

Reference:	https://pkg-status.freebsd.org/beefy18/data/main-amd64-default/p100a5c5dca85_sb347c22846/logs/snoopy-2.4.15.log
  • Loading branch information
sunpoet committed May 2, 2023
1 parent 94713ba commit 94d2d70
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions security/snoopy/files/patch-src-datasource-tid.c
@@ -0,0 +1,11 @@
--- src/datasource/tid.c.orig 2021-04-20 15:35:54 UTC
+++ src/datasource/tid.c
@@ -49,7 +49,7 @@
*/
int snoopy_datasource_tid (char * const result, char const * const arg)
{
- long unsigned int tid = pthread_self();
+ long unsigned int tid = (long unsigned int) pthread_self();

// This happens if -lpthread is not given to compiler
if (0 == tid) {

0 comments on commit 94d2d70

Please sign in to comment.