← Commit list

57b56674a

Bernhard Reutner-Fischer
Bernhard Reutner-Fischer
2006-09-11
SOURCE BUG Duration: 45s

Subject

- merge xstat.c into xfuncs.c

SOURCE BUG

This commit was genuinely broken at the time (not related to our build system): scripts/config/mkconfigs.c (2005-08-01 - 2006-10-05 arasi) uretilen bbconfigopts.h icine .config satirlarini kacissiz, ham newline'larla gömüyordu - gecerli C degildi, busybox'un kendi bb_mkdep araci bile parse edemiyordu (7d219aab7 ile duzeltildi, mkconfigs shell scripte cevrildi)

→ Bu hatanin tam hikayesini ve duzeltme diffini gor

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

include/libbb.h+1 -1
@@ -189,7 +189,7 @@ extern FILE *xfopen(const char *path, const char *mode);
extern int bb_fclose_nonstdin(FILE *f);
extern void bb_fflush_stdout_and_exit(int retval) ATTRIBUTE_NORETURN;
-extern void xstat(const char *filename, struct stat *buf);
+extern void xstat(const char * const filename, struct stat *buf);
extern int xsocket(int domain, int type, int protocol);
extern pid_t spawn(char **argv);
extern pid_t xspawn(char **argv);
libbb/Makefile.in+1 -1
@@ -29,7 +29,7 @@ LIBBB-y:= \
safe_strncpy.c setup_environment.c sha1.c simplify_path.c \
trim.c u_signal_names.c vdprintf.c verror_msg.c \
info_msg.c vinfo_msg.c \
- vherror_msg.c vperror_msg.c wfopen.c xconnect.c xgetcwd.c xstat.c \
+ vherror_msg.c vperror_msg.c wfopen.c xconnect.c xgetcwd.c \
xgethostbyname.c xgethostbyname2.c xreadlink.c xgetlarg.c \
get_terminal_width_height.c fclose_nonstdin.c fflush_stdout_and_exit.c \
getopt_ulflags.c default_error_retval.c wfopen_input.c speed_table.c \
libbb/xfuncs.c+10 -0
@@ -487,3 +487,13 @@ void xlisten(int s, int backlog)
if (listen(s, backlog)) bb_perror_msg_and_die("listen");
}
#endif
+
+#ifdef L_xstat
+/* xstat() - a stat() which dies on failure with meaningful error message */
+void xstat(const char * const name, struct stat *stat_buf)
+{
+ if (stat(name, stat_buf))
+ bb_perror_msg_and_die("Can't stat '%s'", name);
+}
+#endif
+
libbb/xstat.c+0 -12
@@ -1,12 +0,0 @@
-/* vi: set sw=4 ts=4: */
-/*
- * xstat.c - a stat() which dies on failure with meaningful error message
- */
-#include <unistd.h>
-#include "libbb.h"
-
-void xstat(const char *name, struct stat *stat_buf)
-{
- if (stat(name, stat_buf))
- bb_perror_msg_and_die("Can't stat '%s'", name);
-}