Commit bafc47fd authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Declare sig_exit as volatile

sig_exit may be changed by a signal handler, so its value should always be
read from RAM.
parent 3fc148ae
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#include "feh.h"
#include "filelist.h"
#include "signals.h"
#include "options.h"

gib_list *filelist = NULL;
@@ -37,7 +38,6 @@ gib_list *original_file_items = NULL; /* original file items from argv */
int filelist_len = 0;
gib_list *current_file = NULL;
extern int errno;
extern int sig_exit; /* exit flag from signal handler */

static gib_list *rm_filelist = NULL;

+1 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#include "feh.h"
#include "filelist.h"
#include "signals.h"
#include "winwidget.h"
#include "options.h"

@@ -37,7 +38,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#ifdef HAVE_LIBCURL
#include <curl/curl.h>
extern int sig_exit;
#endif

#ifdef HAVE_LIBEXIF
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "options.h"

void feh_handle_signal(int);
int sig_exit = 0;
volatile int sig_exit = 0;

void setup_signal_handlers()
{
+1 −1
Original line number Diff line number Diff line
@@ -27,5 +27,5 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SIGNALS_H

void setup_signal_handlers();
extern int sig_exit;
volatile extern int sig_exit;
#endif