summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorpeterbud <peterbudai@hotmail.com>2016-11-19 23:53:03 +0100
committerMarcus Meissner <marcus@jet.franken.de>2016-11-20 00:02:48 +0100
commit7f00f3ba2267597c560e1b5a9416574414ec828f (patch)
tree93eaaad9becc2786b8ba79aaa83a8d5de9a6fcc3 /examples
parent2832b91497226f7a1e8297de77451de3868fbd30 (diff)
downloadlibgphoto2-7f00f3ba2267597c560e1b5a9416574414ec828f.tar.gz
do not use the signals in win32
Diffstat (limited to 'examples')
-rw-r--r--examples/sample-photobooth.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/examples/sample-photobooth.c b/examples/sample-photobooth.c
index 180e4e366..67588accd 100644
--- a/examples/sample-photobooth.c
+++ b/examples/sample-photobooth.c
@@ -17,8 +17,7 @@
#define CONFIG_FILE "config.txt"
#define PREVIEW "preview.jpg"
-static void errordumper(GPLogLevel level, const char *domain, const char *str,
- void *data) {
+static void errordumper(GPLogLevel level, const char *domain, const char *str, void *data) {
/* printf("%s (data %p)\n", str,data);*/
}
@@ -70,15 +69,19 @@ capture_to_file(Camera *camera, GPContext *context, char *fn) {
static void
sig_handler_capture_now (int sig_num)
{
- signal (SIGUSR1, sig_handler_capture_now);
- capture_now = 1;
+#if !defined (WIN32)
+ signal (SIGUSR1, sig_handler_capture_now);
+#endif
+ capture_now = 1;
}
static void
sig_handler_read_config (int sig_num)
{
- signal (SIGUSR2, sig_handler_read_config);
- read_config = 1;
+#if !defined (WIN32)
+ signal (SIGUSR2, sig_handler_read_config);
+#endif
+ read_config = 1;
}
int
@@ -94,8 +97,10 @@ main(int argc, char **argv) {
printf("kill -USR2 %d to read the 'config.txt'.\n", getpid());
printf("kill -TERM %d to finish.\n", getpid());
- signal (SIGUSR1, sig_handler_capture_now);
- signal (SIGUSR2, sig_handler_read_config);
+#if !defined (WIN32)
+ signal (SIGUSR1, sig_handler_capture_now);
+ signal (SIGUSR2, sig_handler_read_config);
+#endif
gp_log_add_func(GP_LOG_ERROR, errordumper, 0);
gp_camera_new(&camera);