summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3a5aa8e)
some of these were coming from stdio functions locking files without
unlocking them. I believe it's useful for this to throw a warning, so
I added a new macro that's self-documenting that the file will never
be unlocked to avoid the warning in the few places where it's wrong.
+#define FFINALLOCK(f) ((f)->lock>=0 ? __lockfile((f)) : 0)
#define FLOCK(f) int __need_unlock = ((f)->lock>=0 ? __lockfile((f)) : 0)
#define FUNLOCK(f) if (__need_unlock) __unlockfile((f)); else
#define FLOCK(f) int __need_unlock = ((f)->lock>=0 ? __lockfile((f)) : 0)
#define FUNLOCK(f) if (__need_unlock) __unlockfile((f)); else
char buf[2*NAME_MAX+2];
const char *pathname;
unsigned char *base, *map;
char buf[2*NAME_MAX+2];
const char *pathname;
unsigned char *base, *map;
struct dso *p, temp_dso = {0};
int fd;
struct stat st;
struct dso *p, temp_dso = {0};
int fd;
struct stat st;
} else {
int fd;
char *ldname = argv[0];
} else {
int fd;
char *ldname = argv[0];
- size_t dyno, l = strlen(ldname);
+ size_t l = strlen(ldname);
if (l >= 3 && !strcmp(ldname+l-3, "ldd")) ldd_mode = 1;
*argv++ = (void *)-1;
if (argv[0] && !strcmp(argv[0], "--")) *argv++ = (void *)-1;
if (l >= 3 && !strcmp(ldname+l-3, "ldd")) ldd_mode = 1;
*argv++ = (void *)-1;
if (argv[0] && !strcmp(argv[0], "--")) *argv++ = (void *)-1;
update_tls_size();
if (tls_cnt) {
update_tls_size();
if (tls_cnt) {
void *mem = mmap(0, libc.tls_size, PROT_READ|PROT_WRITE,
MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
if (mem==MAP_FAILED ||
void *mem = mmap(0, libc.tls_size, PROT_READ|PROT_WRITE,
MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
if (mem==MAP_FAILED ||
static void close_file(FILE *f)
{
if (!f) return;
static void close_file(FILE *f)
{
if (!f) return;
if (f->wpos > f->wbase) f->write(f, 0, 0);
if (f->rpos < f->rend) f->seek(f, f->rpos-f->rend, SEEK_CUR);
}
if (f->wpos > f->wbase) f->write(f, 0, 0);
if (f->rpos < f->rend) f->seek(f, f->rpos-f->rend, SEEK_CUR);
}
- /* This lock is not paired with any unlock. */
- FLOCK(f);
if (!(perm = f->flags & F_PERM)) {
OFLLOCK();
if (!(perm = f->flags & F_PERM)) {
OFLLOCK();