*: better string sharing

text   data    bss    dec    hex filename
 849427    441   7556 857424  d1550 busybox_old
 849355    441   7556 857352  d1508 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2010-06-02 12:57:26 +02:00
parent 8837c5dec4
commit ea8b252cb3
10 changed files with 22 additions and 26 deletions

View File

@ -3529,20 +3529,18 @@ static void set_tainted(int fd, const char *m_name,
/* Check if loading this module will taint the kernel. */
static void check_tainted_module(struct obj_file *f, const char *m_name)
{
static const char tainted_file[] ALIGN1 = TAINT_FILENAME;
int fd, kernel_has_tainted;
const char *ptr;
kernel_has_tainted = 1;
fd = open(tainted_file, O_RDWR);
fd = open(TAINT_FILENAME, O_RDWR);
if (fd < 0) {
if (errno == ENOENT)
kernel_has_tainted = 0;
else if (errno == EACCES)
kernel_has_tainted = 1;
else {
perror(tainted_file);
perror(TAINT_FILENAME);
kernel_has_tainted = 0;
}
}