tools/mkenvimage.c: fix basename(3) usage
PATCH 1/1 tools/mkenvimage.c: fix basename(3) usage
Use the POSIX variant of basename due to BSD systems (e.g. OS X) do not provide GNU version of basename(3). It is save to use the POSIX variant here cause we do never use argv[0] later on which may be modified by the basename(3) POSIX variant.
On systems providing GNU variant the GNU variant should be used since string.h is included before libgen.h. Therefore let the _GNU_SOURCE as is.
This patch fixes following warning (on OS X):
---8<---mkenvimage.c: In function ?main?:
mkenvimage.c:105: warning: implicit declaration of function ?basename? mkenvimage.c:105: warning: assignment makes pointer from integer without a cast --->8---
---
This was sent by Keith Mok before. Read
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/126003
tools/mkenvimage.c | 1 +
1 Datei ge?ndert, 1 Zeile hinzugef?gt(+)
tools/mkenvimage.c +1 -0
@@ -35,6 +35,7 @@#include <stdint.h> #include <string.h> #include <unistd.h> +#include <libgen.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/mman.h>
Signature · 1 line
1.7.11
Wolfgang Denk
AppliedPATCH 1/1 tools/mkenvimage.c: fix basename(3) usage
Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,
Quoted 14 lines · In message <[email protected]>…
Use the POSIX variant of basename due to BSD systems (e.g. OS X) do not provide GNU version of basename(3). It is save to use the POSIX variant here cause we do never use argv[0] later on which may be modified by the basename(3) POSIX variant.
On systems providing GNU variant the GNU variant should be used sincestring.his included beforelibgen.h. Therefore let the_GNU_SOURCEas is.This patch fixes following warning (on OS X):
---8<---mkenvimage.c: In function ?main?:
mkenvimage.c:105: warning: implicit declaration of function ?basename? mkenvimage.c:105: warning: assignment makes pointer from integer without a cast --->8---
Quoted 8 lines
Signed-off-by Andreas Bie?mann <[email protected]>cc Keith Mok <[email protected]>---
This was sent by Keith Mok before. Read
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/126003tools/mkenvimage.c | 1 +1 Datei ge?ndert, 1 Zeile hinzugef?gt(+)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Neckties strangle clear thinking. -- Lin Yutang