/* socket to communicate errors with sessiond */
static int error_socket = -1;
+/* to count the number of time the user pressed ctrl+c */
+static int sigintcount = 0;
+
/* Argument variables */
int opt_quiet;
int opt_verbose;
/* Opening the tracefile in write mode */
DBG("Opening %s for writing", tmp_fd->path_name);
ret = open(tmp_fd->path_name,
- O_WRONLY|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO);
+ O_WRONLY|O_CREAT|O_TRUNC, S_IRWXU|S_IRWXG|S_IRWXO);
if (ret < 0) {
ERR("Opening %s", tmp_fd->path_name);
perror("open");
*/
static void sighandler(int sig)
{
+ if (sig == SIGINT && sigintcount++ == 0) {
+ DBG("ignoring first SIGINT");
+ return;
+ }
+
cleanup();
return;