Re: CD-RW

Horst von Brand (vonbrand@sleipnir.valparaiso.cl)
Thu, 27 May 1999 21:01:37 -0400


alex.buell@tahallah.demon.co.uk said:

[...]

> Here's a patch to get rid of sys_errlist and replace it with strerror.
> That is what POSIX tells us to do, right?
>
> Only in em-4.0.15-lt-new: em
> diff -ur em-4.0.15-lt/lock.c em-4.0.15-lt-new/lock.c
> --- em-4.0.15-lt/lock.c Sun May 16 08:04:17 1999
> +++ em-4.0.15-lt-new/lock.c Mon May 24 13:50:57 1999
> @@ -153,7 +153,7 @@
> strcpy(obuf, errstr);
> strcat(obuf, " - ");
> if (errno < sys_nerr)
> - strcat(obuf, sys_errlist[errno]);
> + strcat(obuf, strerror(errno));
> else
> strcat(obuf, "(can not get system error message)");
> mlwrite(obuf);

The while "if (errno < sys_nerr)" can be safely replaced by:

strcat(obuf, strerror(errno));

as the manual page assures that a reasonable message is given if the errno
is unknown.

-- 
Horst von Brand                             vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Viņa del Mar, Chile                               +56 32 672616

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/