[Pcsclite-cvs-commit] r4238 - /trunk/PCSC/src/winscard_clnt.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue Jun 2 06:35:55 UTC 2009


Author: rousseau
Date: Tue Jun  2 06:35:55 2009
New Revision: 4238

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4238
Log:
WaitForPcscdEvent(): check mkfifo(3) succeeds

Thanks to Steve Grubb for the bug report

Modified:
    trunk/PCSC/src/winscard_clnt.c

Modified: trunk/PCSC/src/winscard_clnt.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard_clnt.c?rev=4238&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_clnt.c (original)
+++ trunk/PCSC/src/winscard_clnt.c Tue Jun  2 06:35:55 2009
@@ -1724,7 +1724,7 @@
 {
 	char filename[FILENAME_MAX];
 	char buf[1];
-	int fd;
+	int fd, r;
 	struct timeval tv, *ptv = NULL;
 	struct timeval before, after;
 	fd_set read_fd;
@@ -1741,7 +1741,13 @@
 
 	(void)snprintf(filename, sizeof(filename), "%s/event.%d.%ld",
 		PCSCLITE_EVENTS_DIR, SYS_GetPID(), hContext);
-	(void)mkfifo(filename, 0644);
+	r = mkfifo(filename, 0644);
+	if (-1 == r)
+	{
+		Log2(PCSC_LOG_CRITICAL, "Can't create event fifo: %s", strerror(errno));
+		goto exit;
+	}
+
 	fd = SYS_OpenFile(filename, O_RDONLY | O_NONBLOCK, 0);
 
 	/* the file may have been removed between the mkfifo() and open() */
@@ -1767,6 +1773,7 @@
 		dwTime -= diff/1000;
 	}
 
+exit:
 	return dwTime;
 }
 




More information about the Pcsclite-cvs-commit mailing list