summaryrefslogtreecommitdiff
path: root/recipes/mgetty/mgetty-1.1.30/40-locks.c_bug153394
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/mgetty/mgetty-1.1.30/40-locks.c_bug153394
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/mgetty/mgetty-1.1.30/40-locks.c_bug153394')
-rw-r--r--recipes/mgetty/mgetty-1.1.30/40-locks.c_bug15339460
1 files changed, 60 insertions, 0 deletions
diff --git a/recipes/mgetty/mgetty-1.1.30/40-locks.c_bug153394 b/recipes/mgetty/mgetty-1.1.30/40-locks.c_bug153394
new file mode 100644
index 0000000000..0de2fb6b0f
--- /dev/null
+++ b/recipes/mgetty/mgetty-1.1.30/40-locks.c_bug153394
@@ -0,0 +1,60 @@
+--- mgetty-1.1.28.old/locks.c 2001-01-06 12:46:34.000000000 -0500
++++ mgetty-1.1.28/locks.c 2002-08-03 16:25:02.000000000 -0400
+@@ -394,9 +394,42 @@
+
+ #else /* not SVR4 */
+
++static char * unslash_name _P1 ( (device),
++ char *device )
++{
++ char *lock_device, *ldev_begin, *ldevice_orig;
++
++ ldevice_orig = malloc( strlen (device) + 1 );
++ sprintf( ldevice_orig, "%s", device );
++
++ lock_device = strchr( ldevice_orig, '/' );
++ while (lock_device)
++ {
++ *lock_device = '_';
++ lock_device = strchr( lock_device, '/' );
++ }
++
++ if ( *ldevice_orig == '_' )
++ {
++ lock_device = strchr( ldevice_orig + 1, '_' );
++ if (! lock_device)
++ lock_device = ldevice_orig;
++ lock_device++;
++ }
++ else
++ lock_device = ldevice_orig;
++
++ ldev_begin = malloc( strlen( lock_device ) + 1 );
++ sprintf( ldev_begin, "%s", lock_device );
++ free( ldevice_orig );
++
++ return ldev_begin;
++}
++
+ static char * get_lock_name _P2( (lock_name, device),
+ char * lock_name, char * device )
+ {
++ char *lock;
+ #ifdef LOCKS_LOWERCASE
+ /* sco locking convention -> change all device names to lowercase */
+
+@@ -425,10 +458,10 @@
+ #endif /* LOCKS_LOWERCASE */
+
+ /* throw out all directory prefixes */
+- if ( strchr( device, '/' ) != NULL )
+- device = strrchr( device, '/' ) +1;
+-
+- sprintf( lock_name, LOCK, device);
++
++ lock = unslash_name ( device );
++ sprintf( lock_name, LOCK, lock );
++ free ( lock );
+
+ return lock_name;
+ }