Explicitly ignore the result of write(2): even if write(2) fails,

the show must go on (upstream svn revision 6511)

While here, merge PFRAG.shared into PLIST, to quiesce update-plist
This commit is contained in:
dcoppa 2013-02-04 09:25:20 +00:00
parent fcefc40460
commit 3a19c3d8e5
4 changed files with 32 additions and 15 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.15 2013/01/22 12:07:47 dcoppa Exp $
# $OpenBSD: Makefile,v 1.16 2013/02/04 09:25:20 dcoppa Exp $
COMMENT= resource manager for PC/SC
DISTNAME= pcsc-lite-1.8.8
REVISION= 0
CATEGORIES= security
SHARED_LIBS+= pcsclite 1.0 # 1.0.0

View File

@ -1,6 +1,10 @@
$OpenBSD: patch-src_spy_libpcscspy_c,v 1.1 2012/08/06 13:03:12 dcoppa Exp $
--- src/spy/libpcscspy.c.orig Thu Aug 2 19:26:23 2012
+++ src/spy/libpcscspy.c Mon Aug 6 09:33:15 2012
$OpenBSD: patch-src_spy_libpcscspy_c,v 1.2 2013/02/04 09:25:20 dcoppa Exp $
Explicitly ignore the result of write(2): even if write(2) fails,
the show must go on (upstream svn revision 6511)
--- src/spy/libpcscspy.c.orig Sun Aug 5 10:37:37 2012
+++ src/spy/libpcscspy.c Mon Feb 4 09:53:46 2013
@@ -28,6 +28,7 @@
#include <unistd.h>
#include <sys/time.h>
@ -9,21 +13,35 @@ $OpenBSD: patch-src_spy_libpcscspy_c,v 1.1 2012/08/06 13:03:12 dcoppa Exp $
#include "misc.h"
#include <winscard.h>
@@ -168,7 +169,7 @@ static void spy_line_direct(char *line)
@@ -168,11 +169,11 @@ static void spy_line_direct(char *line)
if (Log_fd < 0)
return;
- snprintf(threadid, sizeof threadid, "%lX@", pthread_self());
+ snprintf(threadid, sizeof threadid, "%" PRIXPTR "@", (uintptr_t)pthread_self());
pthread_mutex_lock(&Log_fd_mutex);
write(Log_fd, threadid, strlen(threadid));
write(Log_fd, line, strlen(line));
@@ -195,7 +196,7 @@ static void spy_line(const char *fmt, ...)
- write(Log_fd, threadid, strlen(threadid));
- write(Log_fd, line, strlen(line));
- write(Log_fd, "\n", 1);
+ (void)write(Log_fd, threadid, strlen(threadid));
+ (void)write(Log_fd, line, strlen(line));
+ (void)write(Log_fd, "\n", 1);
pthread_mutex_unlock(&Log_fd_mutex);
}
@@ -195,11 +196,11 @@ 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, "%" PRIXPTR "@", (uintptr_t)pthread_self());
pthread_mutex_lock(&Log_fd_mutex);
write(Log_fd, threadid, strlen(threadid));
write(Log_fd, line, size);
- write(Log_fd, threadid, strlen(threadid));
- write(Log_fd, line, size);
- write(Log_fd, "\n", 1);
+ (void)write(Log_fd, threadid, strlen(threadid));
+ (void)write(Log_fd, line, size);
+ (void)write(Log_fd, "\n", 1);
pthread_mutex_unlock(&Log_fd_mutex);
}

View File

@ -1,3 +0,0 @@
@comment $OpenBSD: PFRAG.shared,v 1.4 2012/08/06 13:03:12 dcoppa Exp $
@lib lib/libpcsclite.so.${LIBpcsclite_VERSION}
@lib lib/libpcscspy.so.${LIBpcscspy_VERSION}

View File

@ -1,5 +1,4 @@
@comment $OpenBSD: PLIST,v 1.4 2012/08/06 13:03:12 dcoppa Exp $
%%SHARED%%
@comment $OpenBSD: PLIST,v 1.5 2013/02/04 09:25:20 dcoppa Exp $
bin/pcsc-spy
include/PCSC/
include/PCSC/debuglog.h
@ -10,8 +9,10 @@ include/PCSC/winscard.h
include/PCSC/wintypes.h
lib/libpcsclite.a
lib/libpcsclite.la
@lib lib/libpcsclite.so.${LIBpcsclite_VERSION}
lib/libpcscspy.a
lib/libpcscspy.la
@lib lib/libpcscspy.so.${LIBpcscspy_VERSION}
lib/pkgconfig/libpcsclite.pc
@man man/man1/pcsc-spy.1
@man man/man5/reader.conf.5