int i = 0;
int result = 0;
struct dirent *dp;
- long int save0;
- long int rewind;
+ off_t save0, rewind_ret;
dirp = opendir (".");
if (dirp == NULL)
/* Check rewinddir */
rewinddir (dirp);
- rewind = telldir (dirp);
- if (rewind == -1)
+ rewind_ret = telldir (dirp);
+ if (rewind_ret == -1)
{
printf ("telldir failed: %s\n", strerror(errno));
result = 1;
}
- else if (save0 != rewind)
+ else if (save0 != rewind_ret)
{
printf ("rewinddir didn't reset directory stream\n");
result = 1;
{
unsigned long status = 0;
event_t foo;
- struct timespec time;
+ struct timespec timeout;
struct timeval now;
long ms = (long) ms_param;
/* set the time out value */
printf("waiting %ld ms ...\n", ms);
gettimeofday(&now, NULL);
- time.tv_sec = now.tv_sec + ms/1000 + (now.tv_usec + (ms%1000)*1000)/1000000;
- time.tv_nsec = ((now.tv_usec + (ms%1000)*1000) % 1000000) * 1000;
+ timeout.tv_sec = now.tv_sec + ms/1000 + (now.tv_usec + (ms%1000)*1000)/1000000;
+ timeout.tv_nsec = ((now.tv_usec + (ms%1000)*1000) % 1000000) * 1000;
/* Just use this to test the time out. The cond var is never signaled. */
pthread_mutex_lock(&foo.mutex);
while (foo.flag == 0 && status != ETIMEDOUT) {
- status = pthread_cond_timedwait(&foo.cond, &foo.mutex, &time);
+ status = pthread_cond_timedwait(&foo.cond, &foo.mutex, &timeout);
}
pthread_mutex_unlock(&foo.mutex);
{
pid_t mypid;
struct sigaction siga;
- static sigset_t sigset;
+ static sigset_t set;
/* Set up sighandling */
- sigfillset(&sigset);
+ sigfillset(&set);
siga.sa_handler = test_handler;
- siga.sa_mask = sigset;
+ siga.sa_mask = set;
siga.sa_flags = 0;
if (sigaction(SIGCHLD, &siga, (struct sigaction *)NULL) != 0) {
fprintf(stderr, "sigaction choked: %s!", strerror(errno));
#define SIMPLE_COPY(fn, n, str, ntest) \
do { \
int __n; \
- char *cp; \
for (__n = 0; __n < (int) sizeof (one); ++__n) \
one[__n] = 'Z'; \
fn (one, str); \
volatile int gotit = 0;
static void
-alarm_handler (int signal)
+alarm_handler (int signum)
{
gotit = 1;
}
char buf[BUFSIZ];
if (argc > 0)
{
- static char buf[BUFSIZ];
- sprintf(buf, "TZ=%s", *argv);
- if (putenv(buf))
+ static char tzenvbuf[BUFSIZ];
+ sprintf(tzenvbuf, "TZ=%s", *argv);
+ if (putenv(tzenvbuf))
{
puts("putenv failed.");
lose = 1;
}
else
- puts (buf);
+ puts (tzenvbuf);
}
tzset();
tbuf.tm_year = 72;