mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 19:52:48 +00:00
Merged revisions 176249,176252 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r176249 | mmichelson | 2009-02-16 15:34:27 -0600 (Mon, 16 Feb 2009) | 14 lines Open the DAHDI pseudo device and set it to be nonblocking atomically Apparently on FreeBSD, attempting to set the O_NONBLOCKING flag separately from opening the file was causing an "inappropriate ioctl for device" error. While I cannot fathom why this would be happening, I certainly am not opposed to making the code a bit more compact/efficient if it also fixes a bug. (closes issue #14482) Reported by: ys Patches: meetme.patch uploaded by ys (license 281) Tested by: ys ........ r176252 | mmichelson | 2009-02-16 15:39:21 -0600 (Mon, 16 Feb 2009) | 3 lines Remove unused variable and make dev-mode compilation happy ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1973,7 +1973,6 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|||||||
int ms;
|
int ms;
|
||||||
int nfds;
|
int nfds;
|
||||||
int res;
|
int res;
|
||||||
int flags;
|
|
||||||
int retrydahdi;
|
int retrydahdi;
|
||||||
int origfd;
|
int origfd;
|
||||||
int musiconhold = 0;
|
int musiconhold = 0;
|
||||||
@@ -2332,24 +2331,13 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|||||||
dahdiretry:
|
dahdiretry:
|
||||||
origfd = chan->fds[0];
|
origfd = chan->fds[0];
|
||||||
if (retrydahdi) {
|
if (retrydahdi) {
|
||||||
fd = open("/dev/dahdi/pseudo", O_RDWR);
|
/* open pseudo in non-blocking mode */
|
||||||
|
fd = open("/dev/dahdi/pseudo", O_RDWR | O_NONBLOCK);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
ast_log(LOG_WARNING, "Unable to open pseudo channel: %s\n", strerror(errno));
|
ast_log(LOG_WARNING, "Unable to open pseudo channel: %s\n", strerror(errno));
|
||||||
goto outrun;
|
goto outrun;
|
||||||
}
|
}
|
||||||
using_pseudo = 1;
|
using_pseudo = 1;
|
||||||
/* Make non-blocking */
|
|
||||||
flags = fcntl(fd, F_GETFL);
|
|
||||||
if (flags < 0) {
|
|
||||||
ast_log(LOG_WARNING, "Unable to get flags: %s\n", strerror(errno));
|
|
||||||
close(fd);
|
|
||||||
goto outrun;
|
|
||||||
}
|
|
||||||
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK)) {
|
|
||||||
ast_log(LOG_WARNING, "Unable to set flags: %s\n", strerror(errno));
|
|
||||||
close(fd);
|
|
||||||
goto outrun;
|
|
||||||
}
|
|
||||||
/* Setup buffering information */
|
/* Setup buffering information */
|
||||||
memset(&bi, 0, sizeof(bi));
|
memset(&bi, 0, sizeof(bi));
|
||||||
bi.bufsize = CONF_SIZE / 2;
|
bi.bufsize = CONF_SIZE / 2;
|
||||||
|
Reference in New Issue
Block a user