mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-13 16:50:06 +00:00
98519d6201
2001-12-28 Andreas Jaeger <aj@suse.de> * io/bug-ftw3.c: Include string.h for prototypes. * crypt/md5test.c (main): Remove unused variable. * linuxthreads_db/td_init.c (td_init): Don't use __FUNCTION__ as literal. * linuxthreads_db/td_log.c (td_log): Likewise. * linuxthreads_db/td_ta_delete.c (td_ta_delete): Likewise. * linuxthreads_db/td_ta_get_nthreads.c (td_ta_get_nthreads): Likewise. * linuxthreads_db/td_ta_get_ph.c (td_ta_get_ph): Likewise. * linuxthreads_db/td_ta_map_id2thr.c (td_ta_map_id2thr): Likewise. * linuxthreads_db/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Likewise. * linuxthreads_db/td_ta_new.c (td_ta_new): Likewise. * linuxthreads_db/td_ta_clear_event.c (td_ta_clear_event): Likewise. * linuxthreads_db/td_ta_enable_stats.c (td_ta_enable_stats): Likewise. * linuxthreads_db/td_ta_event_addr.c (td_ta_event_addr): Likewise. * linuxthreads_db/td_ta_event_getmsg.c (td_ta_event_getmsg): Likewise. * linuxthreads_db/td_ta_get_stats.c (td_ta_get_stats): Likewise. * linuxthreads_db/td_ta_reset_stats.c (td_ta_reset_stats): Likewise. * linuxthreads_db/td_ta_set_event.c (td_ta_set_event): Likewise. * linuxthreads_db/td_ta_setconcurrency.c (td_ta_setconcurrency): Likewise. * linuxthreads_db/td_ta_thr_iter.c (td_ta_thr_iter): Likewise. * linuxthreads_db/td_ta_tsd_iter.c (td_ta_tsd_iter): Likewise. * linuxthreads_db/td_thr_clear_event.c (td_thr_clear_event): Likewise. * linuxthreads_db/td_thr_dbresume.c (td_thr_dbresume): Likewise. * linuxthreads_db/td_thr_dbsuspend.c (td_thr_dbsuspend): Likewise. * linuxthreads_db/td_thr_event_enable.c (td_thr_event_enable): Likewise. * linuxthreads_db/td_thr_event_getmsg.c (td_thr_event_getmsg): Likewise. * linuxthreads_db/td_thr_get_info.c (td_thr_get_info): Likewise. * linuxthreads_db/td_thr_getfpregs.c (td_thr_getfpregs): Likewise. * linuxthreads_db/td_thr_getgregs.c (td_thr_getgregs): Likewise. * linuxthreads_db/td_thr_getxregs.c (td_thr_getxregs): Likewise. * linuxthreads_db/td_thr_getxregsize.c (td_thr_getxregsize): Likewise. * linuxthreads_db/td_thr_set_event.c (td_thr_set_event): Likewise. * linuxthreads_db/td_thr_setfpregs.c (td_thr_setfpregs): Likewise. * linuxthreads_db/td_thr_setgregs.c (td_thr_setgregs): Likewise. * linuxthreads_db/td_thr_setprio.c (td_thr_setprio): Likewise. * linuxthreads_db/td_thr_setsigpending.c (td_thr_setsigpending): Likewise. * linuxthreads_db/td_thr_setxregs.c (td_thr_setxregs): Likewise. * linuxthreads_db/td_thr_sigsetmask.c (td_thr_sigsetmask): Likewise. * linuxthreads_db/td_thr_tsd.c (td_thr_tsd): Likewise. * linuxthreads_db/td_thr_validate.c (td_thr_validate): Likewise. * dlfcn/modstatic.c: Add prototype to avoid warning.
64 lines
1.1 KiB
C
64 lines
1.1 KiB
C
#include <errno.h>
|
|
#include <ftw.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
|
|
static int cb_called;
|
|
|
|
static int
|
|
cb (const char *fname, const struct stat *st, int flag)
|
|
{
|
|
printf ("%s %d\n", fname, flag);
|
|
cb_called = 1;
|
|
return 0;
|
|
}
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
char tmp[] = "/tmp/ftwXXXXXX";
|
|
char tmp2[] = "/tmp/ftwXXXXXX/ftwXXXXXX";
|
|
char *dname;
|
|
char *dname2;
|
|
int r;
|
|
int e;
|
|
|
|
dname = mkdtemp (tmp);
|
|
if (dname == NULL)
|
|
{
|
|
printf ("mkdtemp: %m\n");
|
|
exit (1);
|
|
}
|
|
|
|
memcpy (tmp2, tmp, strlen (tmp));
|
|
dname2 = mkdtemp (tmp2);
|
|
if (dname2 == NULL)
|
|
{
|
|
printf ("mkdtemp: %m\n");
|
|
rmdir (dname);
|
|
exit (1);
|
|
}
|
|
|
|
if (chmod (dname, S_IWUSR|S_IWGRP|S_IWOTH) != 0)
|
|
{
|
|
printf ("chmod: %m\n");
|
|
rmdir (dname);
|
|
exit (1);
|
|
}
|
|
|
|
r = ftw (dname2, cb, 10);
|
|
e = errno;
|
|
printf ("r = %d", r);
|
|
if (r != 0)
|
|
printf (", errno = %d", errno);
|
|
puts ("");
|
|
|
|
chmod (dname, S_IRWXU|S_IRWXG|S_IRWXO);
|
|
rmdir (dname2);
|
|
rmdir (dname);
|
|
|
|
return (r != -1 && e == EACCES) || cb_called;
|
|
}
|