"Up" and "Down" were wrongly used in semaphore operations.

Signed-off-by: guy keren <[email protected]>

note: this patch must be applied on top of the previous patch (that 
fixes the semop race bug).

--guy

--

You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=.


[PATCH 2/3] Fix wrong logs in log.c

"Up" and "Down" were wrongly used in semaphore operations.

Signed-off-by: guy keren <[email protected]>
---
 usr/log.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/usr/log.c b/usr/log.c
index c84ddd9..908aac1 100644
--- a/usr/log.c
+++ b/usr/log.c
@@ -268,7 +268,7 @@ static void dolog(int prio, const char *fmt, va_list ap)
 
 		ops[0].sem_op = -1;
 		if (semop(la->semid, ops, 1) < 0) {
-			syslog(LOG_ERR, "semop up failed %d", errno);
+			syslog(LOG_ERR, "semop down failed %d", errno);
 			return;
 		}
 
@@ -276,7 +276,7 @@ static void dolog(int prio, const char *fmt, va_list ap)
 
 		ops[0].sem_op = 1;
 		if (semop(la->semid, ops, 1) < 0) {
-			syslog(LOG_ERR, "semop down failed");
+			syslog(LOG_ERR, "semop up failed");
 			return;
 		}
 	} else {
@@ -359,13 +359,13 @@ static void log_flush(void)
 	while (!la->empty) {
 		ops[0].sem_op = -1;
 		if (semop(la->semid, ops, 1) < 0) {
-			syslog(LOG_ERR, "semop up failed %d", errno);
+			syslog(LOG_ERR, "semop down failed %d", errno);
 			exit(1);
 		}
 		msglen = log_dequeue(la->buff);
 		ops[0].sem_op = 1;
 		if (semop(la->semid, ops, 1) < 0) {
-			syslog(LOG_ERR, "semop down failed");
+			syslog(LOG_ERR, "semop up failed");
 			exit(1);
 		}
 		if (msglen)
-- 
1.6.3.3

Reply via email to