merge from openbsd: typos, use of O_CLOEXEC, _sndio_debug fix

This commit is contained in:
Alexandre Ratchov 2014-08-19 16:05:29 +02:00
parent 91ce28bc54
commit b20e28a66e
8 changed files with 8 additions and 19 deletions

View File

@ -1525,7 +1525,7 @@ dev_try(struct dev *d, int slot)
#ifdef DEBUG
if (debug_level >= 3) {
dev_slotdbg(d, slot);
dbg_puts(": server not started, delayd\n");
dbg_puts(": server not started, delayed\n");
}
#endif
return 0;

View File

@ -913,7 +913,7 @@ wav_new_out(struct fileops *ops, struct dev *dev,
}
f->mode = mode;
f->pstate = WAV_CFG;
f->endpos = f->startpos = 0;
f->mmcpos = f->endpos = f->startpos = 0;
f->next = wav_list;
wav_list = f;
if (hdr == HDR_WAV) {

View File

@ -77,21 +77,14 @@ _mio_rmidi_open(const char *str, unsigned int mode, int nbio)
flags = O_RDWR;
else
flags = (mode & MIO_OUT) ? O_WRONLY : O_RDONLY;
while ((fd = open(path, flags | O_NONBLOCK)) < 0) {
while ((fd = open(path, flags | O_NONBLOCK | O_CLOEXEC)) < 0) {
if (errno == EINTR)
continue;
DPERROR(path);
goto bad_free;
}
if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) {
DPERROR("FD_CLOEXEC");
goto bad_close;
}
hdl->fd = fd;
return (struct mio_hdl *)hdl;
bad_close:
while (close(hdl->fd) < 0 && errno == EINTR)
; /* retry */
bad_free:
free(hdl);
return NULL;

View File

@ -403,7 +403,7 @@ sio_revents(struct sio_hdl *hdl, struct pollfd *pfd)
#ifdef DEBUG
struct timespec ts0, ts1;
if (_sndio_debug >= 2)
if (_sndio_debug >= 4)
clock_gettime(CLOCK_MONOTONIC, &ts0);
#endif
if (hdl->eof)

View File

@ -365,16 +365,12 @@ _sio_sun_open(const char *str, unsigned int mode, int nbio)
else
flags = (mode & SIO_PLAY) ? O_WRONLY : O_RDONLY;
while ((fd = open(path, flags | O_NONBLOCK)) < 0) {
while ((fd = open(path, flags | O_NONBLOCK | O_CLOEXEC)) < 0) {
if (errno == EINTR)
continue;
DPERROR(path);
goto bad_free;
}
if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) {
DPERROR("FD_CLOEXEC");
goto bad_close;
}
/*
* pause the device

View File

@ -136,7 +136,7 @@ aparams_strtoenc(struct aparams *par, char *istr)
p++;
/*
* get (optional) alignement
* get (optional) alignment
*/
if (p[0] == 'm' && p[1] == 's' && p[2] == 'b') {
msb = 1;

View File

@ -459,7 +459,7 @@ filelist_init(void)
perror("setitimer");
exit(1);
}
//log_sync = 0;
log_sync = 0;
timo_init();
}

View File

@ -174,7 +174,7 @@ or
.Va be
.Pc ,
the number of
bytes per sample, and the alignement
bytes per sample, and the alignment
.Po
.Va msb
or