Implemented --gnokiid arguments for child spawning, not tested yet
[gnokii.git] / common / data / virtmodem.c
index 664127f..bcedc7e 100644 (file)
@@ -51,6 +51,9 @@
 
        /* Global variables */
 
+
+#define GNOKII_DEV "/var/gnokii-dev"
+
 //extern bool TerminateThread;
 
        /* Local variables */
@@ -61,7 +64,6 @@ int           PtyWRFD;        /* pty interface - only different in debug mode. */
 static bool    UseSTDIO;       /* Use STDIO for debugging purposes instead of pty */
 bool   CommandMode;
 
-static bool    VM_ThreadLoop(void);
 static GSM_Error       VM_GSMInitialise(char *model, char *port, char *initlength, GSM_ConnectionType connection, char *synchronizetime);
 static int             VM_PtySetup(char *bindir);
 
@@ -111,7 +113,7 @@ bool VM_Initialise(char *model,char *port, char *initlength, GSM_ConnectionType
 
 static void    VM_CharHandler(void);
 
-static bool VM_ThreadLoop(void)
+bool VM_ThreadLoop(void)
 {
        int res;
        fd_set readfds;
@@ -139,6 +141,8 @@ static bool VM_ThreadLoop(void)
                                break;
 
                        case -1:
+                               if (errno==EINTR)
+                                       continue;
                                perror("VM_ThreadLoop - select");
                                return (false);
 
@@ -210,13 +214,13 @@ static int                VM_PtySetup(char *bindir)
 #endif
 
 #ifdef DEBUG
-       fprintf (stderr, _("Slave pty is %s, calling %s to create /dev/gnokii.\n"), slave_name,
+       fprintf (stderr, _("Slave pty is %s, calling %s to create \"%s\".\n"), slave_name,
 #ifndef UCLINUX
                        mgnokiidev
 #else /* UCLINUX */
                        "<uClinux>"
 #endif /* UCLINUX */
-                       );
+                       ,GNOKII_DEV);
 #endif /* DEBUG */
 
 #ifndef UCLINUX
@@ -228,10 +232,10 @@ static int                VM_PtySetup(char *bindir)
 #else /* UCLINUX */
 
        /* Remove symlink in case it already exists. Don't care if it fails.  */
-       unlink ("/dev/gnokii");
+       unlink (GNOKII_DEV);
 
        /* Create symlink */
-       err = symlink(slave_name, "/dev/gnokii");
+       err = symlink(slave_name, GNOKII_DEV);
 
 #endif /* UCLINUX */