[OS/2] Bug 399647: fix OS/2 build break in prlog.c and correct warning, r=wtc FIREFOX_3_0b1_RC1 FIREFOX_3_0b1_RC2 FIREFOX_3_0b1_RC3 FIREFOX_3_0b1_RELEASE FIREFOX_3_0b2_RC1 FIREFOX_3_0b2_RELEASE NSPR_HEAD_20071016
authormozilla%weilbacher.org
Tue, 16 Oct 2007 18:37:31 +0000
changeset 3870 dd9229982faa31bcf1d93b49336a759f88258412
parent 3868 7839d46896f18e9a953f1c77a0bf339dc6c11c6a
child 3871 64454110bf788b53224e71e9a4edbc6b36e6e0a4
child 3872 50f0fa36925b8861d2416ab3c23995153b062b84
child 3873 1147f0375d908c1d09f2ad26142c865c41a89bd8
push idunknown
push userunknown
push dateunknown
reviewerswtc
bugs399647
[OS/2] Bug 399647: fix OS/2 build break in prlog.c and correct warning, r=wtc
pr/include/md/_os2.h
pr/src/io/prlog.c
pr/src/md/os2/os2cv.c
--- a/pr/include/md/_os2.h
+++ b/pr/include/md/_os2.h
@@ -389,24 +389,17 @@ extern PRInt32 _MD_Accept(PRFileDesc *fd
         SemReleasex86( &(lock)->mutex, 0 ); \
     } \
     PR_END_MACRO
 #else
 #define _MD_NEW_LOCK                  (_PR_MD_NEW_LOCK)
 #define _MD_FREE_LOCK(lock)           (DosCloseMutexSem((lock)->mutex))
 #define _MD_LOCK(lock)                (DosRequestMutexSem((lock)->mutex, SEM_INDEFINITE_WAIT))
 #define _MD_TEST_AND_LOCK(lock)       (DosRequestMutexSem((lock)->mutex, SEM_INDEFINITE_WAIT),0)
-#define _MD_UNLOCK(lock)              \
-    PR_BEGIN_MACRO \
-    if (0 != (lock)->notified.length) { \
-        md_UnlockAndPostNotifies((lock), NULL, NULL); \
-    } else { \
-        DosReleaseMutexSem((lock)->mutex); \
-    } \
-    PR_END_MACRO
+#define _MD_UNLOCK                    (_PR_MD_UNLOCK)
 #endif
 
 /* --- lock and cv waiting --- */
 #define _MD_WAIT                      (_PR_MD_WAIT)
 #define _MD_WAKEUP_WAITER             (_PR_MD_WAKEUP_WAITER)
 
 /* --- CVar ------------------- */
 #define _MD_WAIT_CV					  (_PR_MD_WAIT_CV)
--- a/pr/src/io/prlog.c
+++ b/pr/src/io/prlog.c
@@ -487,17 +487,20 @@ PR_IMPLEMENT(void) PR_LogPrint(const cha
             _PUT_LOG(logFile, logBuf, logp - logBuf);
             logp = logBuf;
         }
         /* Write out the thread id and the malloc'ed buffer. */
         _PUT_LOG(logFile, line, nb_tid);
         _PUT_LOG(logFile, line_long, nb);
         /* Ensure there is a trailing newline. */
         if (!nb || (line_long[nb-1] != '\n')) {
-            _PUT_LOG(logFile, "\n", 1);
+            char eol[2];
+            eol[0] = '\n';
+            eol[1] = '\0';
+            _PUT_LOG(logFile, eol, 1);
         }
         _PR_UNLOCK_LOG();
         PR_smprintf_free(line_long);
     } else {
         /* Ensure there is a trailing newline. */
         if (nb && (line[nb-1] != '\n')) {
             line[nb++] = '\n';
             line[nb] = '\0';
--- a/pr/src/md/os2/os2cv.c
+++ b/pr/src/md/os2/os2cv.c
@@ -425,8 +425,17 @@ PRStatus
 }
 
 void
 _PR_MD_NOTIFYALL_CV(_MDCVar *cv, _MDLock *lock)
 {
     md_PostNotifyToCvar(cv, lock, PR_TRUE);
     return;
 }
+
+void _PR_MD_UNLOCK(_MDLock *lock)
+{
+    if (0 != lock->notified.length) {
+        md_UnlockAndPostNotifies(lock, NULL, NULL);
+    } else {
+        DosReleaseMutexSem(lock->mutex);
+    }
+}