[exim] Patch for Exim 4.91 compile warning

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Mike Tubby
Date:  
À: exim-users
Sujet: [exim] Patch for Exim 4.91 compile warning
All,

When compiling Exim 4.91 on Ubuntu 16.04.5 LTS I get a gcc warning in
the USR1 signal handler:

gcc exim.c
exim.c: In function ‘usr1_handler’:
exim.c:242:1: warning: ignoring return value of ‘write’, declared with
attribute warn_unused_result [-Wunused-result]
 (void)write(fd, process_info, process_info_len);
 ^
gcc expand.c

The following patch addresses the issue and should be safe for all
platforms:

root@relay1:~/exim-4.91/src# diff exim.c-orig exim.c
240c240,251
< if (fd < 0) return;
---
> //if (fd < 0) return;
> //
> //(void)write(fd, process_info, process_info_len);
> //(void)close(fd);
>
> if (fd > 0) {
>   ssize_t x;
>   int y;
>
>   x = write(fd, process_info, process_info_len);
>   y = close(fd);
>   }

242,243d252
< (void)write(fd, process_info, process_info_len);
< (void)close(fd);


Regards


Mike Tubby MJT4-RIPE