Opened 9 years ago

Closed 9 years ago

#6193 closed defect (fixed)

apps/gdalserver.c uses signal definitions without signal.h

Reported by: gdt Owned by: warmerdam
Priority: normal Milestone: 2.0.2
Component: ConfigBuild Version: unspecified
Severity: normal Keywords:
Cc:

Description

According to POSIX, one must include signal.h when using signal(3).

Attachments (1)

signal-patch.txt (361 bytes ) - added by gdt 9 years ago.

Download all attachments as: .zip

Change History (5)

by gdt, 9 years ago

Attachment: signal-patch.txt added

comment:1 by Kurt Schwehr, 9 years ago

+1 on the bug, but I am working on an alternate patch

comment:2 by Kurt Schwehr, 9 years ago

Propose change to cpl_spawn.cpp rather than port.

  • cpl_spawn.cpp

     
    3434#include "cpl_string.h"
    3535#include "cpl_multiproc.h"
    3636
     37#ifdef SIGPIPE
     38#  include <csignal>
     39#endif
     40
    3741#define PIPE_BUFFER_SIZE    4096
    3842
    3943#define IN_FOR_PARENT   0

comment:3 by Kurt Schwehr, 9 years ago

Sorry, I see you meant gdalserver.c. Ignore my last. I've applied the patch to gdalserver.c but doing it by hand.

r31286

The line numbers in the patch are bad. If not all systems define SIGPIPE, we may need a #ifdefined around

     if( !bFork )
         signal(SIGPIPE, SIG_IGN);

comment:4 by Even Rouault, 9 years ago

Resolution: fixed
Status: newclosed

branches/2.0 r31326 "Add include of signal.h for SIGPIPE and signal(). (patch by Greg Troxel, #6193)"

Note: See TracTickets for help on using tickets.