diff options
Diffstat (limited to 'meta/recipes-core/glibc/glibc/0017-Replace-echo-with-printf-builtin-in-nscd-init-script.patch')
-rw-r--r-- | meta/recipes-core/glibc/glibc/0017-Replace-echo-with-printf-builtin-in-nscd-init-script.patch | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/0017-Replace-echo-with-printf-builtin-in-nscd-init-script.patch b/meta/recipes-core/glibc/glibc/0017-Replace-echo-with-printf-builtin-in-nscd-init-script.patch new file mode 100644 index 0000000000..d8c0b1b4ad --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0017-Replace-echo-with-printf-builtin-in-nscd-init-script.patch | |||
@@ -0,0 +1,79 @@ | |||
1 | From 0aac3b8ee5b13e289b6969da51de384443286a5b Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 31 Dec 2015 14:33:02 -0800 | ||
4 | Subject: [PATCH] Replace echo with printf builtin in nscd init script | ||
5 | |||
6 | The nscd init script calls for #! /bin/bash interpreter | ||
7 | since it uses bash specific extentions namely (translated strings) | ||
8 | and echo -n command, replace echo with printf and | ||
9 | switch the shell interpreter to #!/bin/sh. | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | nscd/nscd.init | 20 ++++++++++---------- | ||
16 | 1 file changed, 10 insertions(+), 10 deletions(-) | ||
17 | |||
18 | diff --git a/nscd/nscd.init b/nscd/nscd.init | ||
19 | index a882da7d8b..857b541381 100644 | ||
20 | --- a/nscd/nscd.init | ||
21 | +++ b/nscd/nscd.init | ||
22 | @@ -1,4 +1,4 @@ | ||
23 | -#!/bin/bash | ||
24 | +#!/bin/sh | ||
25 | # | ||
26 | # nscd: Starts the Name Switch Cache Daemon | ||
27 | # | ||
28 | @@ -49,16 +49,16 @@ prog=nscd | ||
29 | start () { | ||
30 | [ -d /var/run/nscd ] || mkdir /var/run/nscd | ||
31 | [ -d /var/db/nscd ] || mkdir /var/db/nscd | ||
32 | - echo -n $"Starting $prog: " | ||
33 | + printf "Starting $prog: " | ||
34 | daemon /usr/sbin/nscd | ||
35 | RETVAL=$? | ||
36 | - echo | ||
37 | + printf "\n" | ||
38 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd | ||
39 | return $RETVAL | ||
40 | } | ||
41 | |||
42 | stop () { | ||
43 | - echo -n $"Stopping $prog: " | ||
44 | + printf "Stopping $prog: " | ||
45 | /usr/sbin/nscd -K | ||
46 | RETVAL=$? | ||
47 | if [ $RETVAL -eq 0 ]; then | ||
48 | @@ -67,11 +67,11 @@ stop () { | ||
49 | # a non-privileged user | ||
50 | rm -f /var/run/nscd/nscd.pid | ||
51 | rm -f /var/run/nscd/socket | ||
52 | - success $"$prog shutdown" | ||
53 | + success "$prog shutdown" | ||
54 | else | ||
55 | - failure $"$prog shutdown" | ||
56 | + failure "$prog shutdown" | ||
57 | fi | ||
58 | - echo | ||
59 | + printf "\n" | ||
60 | return $RETVAL | ||
61 | } | ||
62 | |||
63 | @@ -103,13 +103,13 @@ case "$1" in | ||
64 | RETVAL=$? | ||
65 | ;; | ||
66 | force-reload | reload) | ||
67 | - echo -n $"Reloading $prog: " | ||
68 | + printf "Reloading $prog: " | ||
69 | killproc /usr/sbin/nscd -HUP | ||
70 | RETVAL=$? | ||
71 | - echo | ||
72 | + printf "\n" | ||
73 | ;; | ||
74 | *) | ||
75 | - echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" | ||
76 | + printf "Usage: $0 {start|stop|status|restart|reload|condrestart}\n" | ||
77 | RETVAL=1 | ||
78 | ;; | ||
79 | esac | ||