Diffstat (limited to 'gammu/emb/common/device/devfunc.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | gammu/emb/common/device/devfunc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gammu/emb/common/device/devfunc.c b/gammu/emb/common/device/devfunc.c index d31ebbf..c58a01f 100644 --- a/gammu/emb/common/device/devfunc.c +++ b/gammu/emb/common/device/devfunc.c | |||
@@ -1,6 +1,14 @@ | |||
1 | /* Some source from Gnokii (www.gnokii.org) | ||
2 | * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot | ||
3 | * GNU GPL version 2 or later | ||
4 | */ | ||
5 | /* Some source from Minicom (http://alioth.debian.org/projects/minicom) | ||
6 | * (C) 1991,1992,1993,1994,1995,1996 by Miquel van Smoorenburg | ||
7 | * GNU GPL version 2 | ||
8 | */ | ||
1 | 9 | ||
2 | #include <string.h> | 10 | #include <string.h> |
3 | #ifdef WIN32 | 11 | #ifdef WIN32 |
4 | # include <io.h> | 12 | # include <io.h> |
5 | #else | 13 | #else |
6 | # include <errno.h> | 14 | # include <errno.h> |
@@ -102,13 +110,13 @@ bool unlock_device(char **lock_file) | |||
102 | 110 | ||
103 | /* Lock the device. Allocated string with a lock name is returned | 111 | /* Lock the device. Allocated string with a lock name is returned |
104 | * in lock_device | 112 | * in lock_device |
105 | */ | 113 | */ |
106 | GSM_Error lock_device(const char* port, char **lock_device) | 114 | GSM_Error lock_device(const char* port, char **lock_device) |
107 | { | 115 | { |
108 | #ifndef WIN32 | 116 | #if !defined(WIN32) && !defined(DJGPP) |
109 | char *lock_file = NULL; | 117 | char *lock_file = NULL; |
110 | char buffer[max_buf_len]; | 118 | char buffer[max_buf_len]; |
111 | const char *aux; | 119 | const char *aux; |
112 | int fd, len; | 120 | int fd, len; |
113 | GSM_Errorerror = ERR_NONE; | 121 | GSM_Errorerror = ERR_NONE; |
114 | 122 | ||
@@ -215,13 +223,13 @@ failed: | |||
215 | #endif | 223 | #endif |
216 | } | 224 | } |
217 | 225 | ||
218 | /* Removes lock and frees memory */ | 226 | /* Removes lock and frees memory */ |
219 | bool unlock_device(char **lock_file) | 227 | bool unlock_device(char **lock_file) |
220 | { | 228 | { |
221 | #ifndef WIN32 | 229 | #if !defined(WIN32) && !defined(DJGPP) |
222 | int err; | 230 | int err; |
223 | 231 | ||
224 | if (!lock_file) { | 232 | if (!lock_file) { |
225 | dbgprintf("Cannot unlock device\n"); | 233 | dbgprintf("Cannot unlock device\n"); |
226 | return false; | 234 | return false; |
227 | } | 235 | } |