This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug locale/25195] localedef does not return error status when warnings were issued.


https://sourceware.org/bugzilla/show_bug.cgi?id=25195

--- Comment #2 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to Sergei Trofimovich from comment #0)
> """
> # /usr/bin/localedef -c --no-archive -i en_US -f $'ISO-8859-1\r' -A
> /usr/share/locale/locale.alias --prefix / en_US |& cat -v
> failed to set locale!
> [error] character map file `ISO-8859-1^M' not found: No such file or
> directory
> 
> # echo $?
> 0
> """

You ran two commands. The $? is the exit code of the second command in the
pipe. The exit code of cat was 0 (success) which is expected.

If you run just the localedef command:

/usr/bin/localedef -c --no-archive -i en_US -f 'ISO-8859-1\r' -A
/usr/share/locale/locale.alias --prefix / en_US
[error] character map file `ISO-8859-1\r' not found: No such file or directory
[error] cannot write output files to `//usr/lib/locale/en_US/': Permission
denied
echo $?
4

You get output 4 as expected because errors were encountered and no output was
created.

Note: I removed the '$' in front of the charmap because it doesn't seem to
apply to the example you were trying to create.

Does the above explain why you see an exit code of zero from the last command
in the pipe sequence?

In Bash you can use PIPESTATUS to review the exit status of processes in the
last executed foreground pipeline.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]