From: Gustavo Martin Morcuende Date: Sun, 5 Jun 2016 21:20:28 +0000 (+0200) Subject: locks and fcntllocks, a little improvement X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=4b5f53f636d1c8ff4595bda6170dcaaaee169eab;p=CForFun.git locks and fcntllocks, a little improvement --- diff --git a/locks/fcntllocks.c b/locks/fcntllocks.c index 3308264..220b035 100644 --- a/locks/fcntllocks.c +++ b/locks/fcntllocks.c @@ -152,7 +152,7 @@ void *thread_lock(void * arg) fd = open(fileName, O_CREAT | O_RDWR, 0664); if (fd == -1) { goto end; - print_with_date (stderr, "Thread %d, open file error", threadNumber, strerror(errno)); + print_with_date (stderr, "Thread %d, open file error\n", threadNumber, strerror(errno)); } @@ -206,7 +206,7 @@ int test_require_user() { fd = open(fileName, O_CREAT | O_RDWR, 0664); if (fd == -1) { - print_with_date(stderr, "Open file error", strerror(errno)); + print_with_date(stderr, "Open file error\n", strerror(errno)); goto end; } diff --git a/locks/flocks.c b/locks/flocks.c index df55583..ab7a9f0 100644 --- a/locks/flocks.c +++ b/locks/flocks.c @@ -151,7 +151,7 @@ void *thread_lock(void * arg) fd = open(fileName, O_CREAT | O_RDWR, 0664); if (fd == -1) { goto end; - print_with_date (stderr, "Thread %d, open file error", threadNumber, strerror(errno)); + print_with_date (stderr, "Thread %d, open file error\n", threadNumber, strerror(errno)); } @@ -198,7 +198,7 @@ int test_require_user() { fd = open(fileName, O_CREAT | O_RDWR, 0664); if (fd == -1) { - print_with_date(stderr, "Open file error", strerror(errno)); + print_with_date(stderr, "Open file error\n", strerror(errno)); goto end; }