diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2014-05-29 16:56:28 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2014-05-29 17:17:27 -0400 |
commit | fa9804ae636b8a12f77d0e537f628658d44ea189 (patch) | |
tree | 5147400916b98c93cbc4f23125bdcc69a386467f /dist | |
parent | 48a72c671eb9f7f8ec040f42bacfe62436e37ee1 (diff) | |
download | perl-fa9804ae636b8a12f77d0e537f628658d44ea189.tar.gz |
Build fixes for Win32 after the Coverity smoke.
(for 375ed12a42c6092b1af1d8e395bf3dadd9a66e48)
Diffstat (limited to 'dist')
-rw-r--r-- | dist/IO/IO.xs | 9 | ||||
-rw-r--r-- | dist/threads/threads.xs | 10 |
2 files changed, 13 insertions, 6 deletions
diff --git a/dist/IO/IO.xs b/dist/IO/IO.xs index eed7139fde..4b13feb041 100644 --- a/dist/IO/IO.xs +++ b/dist/IO/IO.xs @@ -566,11 +566,10 @@ sockatmark (sock) InputStream sock PROTOTYPE: $ PREINIT: - int fd; + int fd = PerlIO_fileno(sock); CODE: { #ifdef HAS_SOCKATMARK - int fd = PerlIO_fileno(sock); if (fd < 0) { errno = EBADF; RETVAL = -1; @@ -579,6 +578,11 @@ sockatmark (sock) } #else { + if (fd < 0) { + errno = EBADF; + RETVAL = -1; + } + else { int flag = 0; # ifdef SIOCATMARK # if defined(NETWARE) || defined(WIN32) @@ -592,6 +596,7 @@ sockatmark (sock) # endif RETVAL = flag; } + } #endif } OUTPUT: diff --git a/dist/threads/threads.xs b/dist/threads/threads.xs index 182cd373e4..6175ba7bab 100644 --- a/dist/threads/threads.xs +++ b/dist/threads/threads.xs @@ -714,10 +714,12 @@ S_ithread_create( PERL_SET_CONTEXT(aTHX); if (!thread) { MUTEX_UNLOCK(&MY_POOL.create_destruct_mutex); - int fd = PerlIO_fileno(Perl_error_log); - if (fd >= 0) { - /* If there's no error_log, we cannot scream about it missing. */ - PERL_UNUSED_RESULT(PerlLIO_write(fd, PL_no_mem, strlen(PL_no_mem))); + { + int fd = PerlIO_fileno(Perl_error_log); + if (fd >= 0) { + /* If there's no error_log, we cannot scream about it missing. */ + PERL_UNUSED_RESULT(PerlLIO_write(fd, PL_no_mem, strlen(PL_no_mem))); + } } my_exit(1); } |