Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcsc-lite: fix formats under musl #194

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/debuglog.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ static void log_line(const int priority, const char *DebugBuffer,
break;
}

#ifdef __APPLE__
#ifndef __GLIBC__
#define THREAD_FORMAT "%p"
#else
#define THREAD_FORMAT "%lu"
Expand Down
4 changes: 2 additions & 2 deletions src/spy/libpcscspy.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static void spy_line_direct(char *line)
if (Log_fd < 0)
return;

snprintf(threadid, sizeof threadid, "%lX@", pthread_self());
snprintf(threadid, sizeof threadid, "%lX@", (unsigned long)pthread_self());
pthread_mutex_lock(&Log_fd_mutex);
r = write(Log_fd, threadid, strlen(threadid));
r = write(Log_fd, line, strlen(line));
Expand Down Expand Up @@ -150,7 +150,7 @@ static void spy_line(const char *fmt, ...)
printf("libpcsc-spy: Buffer is too small!\n");
return;
}
snprintf(threadid, sizeof threadid, "%lX@", pthread_self());
snprintf(threadid, sizeof threadid, "%lX@", (unsigned long)pthread_self());
pthread_mutex_lock(&Log_fd_mutex);
r = write(Log_fd, threadid, strlen(threadid));
r = write(Log_fd, line, size);
Expand Down