File: error.c

package info (click to toggle)
gphoto 0.3.5-6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,636 kB
  • ctags: 1,973
  • sloc: ansic: 23,035; sh: 4,851; makefile: 175
file content (31 lines) | stat: -rw-r--r-- 392 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <termios.h>
#include <unistd.h>
#include <stdio.h>

#ifdef _CLI_
 extern struct termios oldt;
#else
 #include "../src/gphoto.h"
#endif


void qm100_error(int serialdev, char *error)
{
#ifdef _CLI_
  perror(error);
#else
  error_dialog(error);
#endif

#ifdef _CLI_
  tcsetattr(serialdev, TCSANOW, &oldt);
#endif

  close(serialdev);
  printf("\nClosed and done!\n");
  exit(1);
}