[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-users] gpsd only started one time (tty already opened)
From: |
Forum |
Subject: |
Re: [gpsd-users] gpsd only started one time (tty already opened) |
Date: |
Sat, 08 Aug 2015 16:17:59 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 |
I could find the check in the source.
#ifdef __linux__
/*
* Don't touch devices already opened by another process.
*/
if (fusercount(session->gpsdata.dev.path) > 1) {
gpsd_log(&session->context->errout, LOG_ERROR,
"%s already opened by another process\n",
session->gpsdata.dev.path);
(void)close(session->gpsdata.gps_fd);
session->gpsdata.gps_fd = UNALLOCATED_FD;
return UNALLOCATED_FD;
}
#endif /* __linux__ */
and
static int fusercount(const char *path)
/* return true if any process has the specified path open */
{
Now i searched and indeed i found a process which has the path 'ttyAMA0' open.
Problem found and solved.
Thanks for the work of gpsd.