From: Terry Jan Reedy Date: Mon, 11 Mar 2013 21:45:12 +0000 (-0400) Subject: Merge 3.2, Issue #17047: remove doubled words found in 2.7 to 3.4 X-Git-Tag: v3.3.1rc1~62 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=09b7503bc999b2c65c9d61465cd19758ff97c0c4;p=thirdparty%2FPython%2Fcpython.git Merge 3.2, Issue #17047: remove doubled words found in 2.7 to 3.4 Modules/*, as reported by Serhiy Storchaka and Matthew Barnett. --- 09b7503bc999b2c65c9d61465cd19758ff97c0c4 diff --cc Modules/ossaudiodev.c index a17a647f26cb,0ac1cb37b9ff..50e266f087f2 --- a/Modules/ossaudiodev.c +++ b/Modules/ossaudiodev.c @@@ -214,23 -214,8 +214,23 @@@ oss_mixer_dealloc(oss_mixer_t *self * Helper functions */ +/* Check if a given file descriptor is valid (i.e. hasn't been closed). + * If true, return 1. Otherwise, raise ValueError and return 0. + */ +static int _is_fd_valid(int fd) +{ + /* the FD is set to -1 in oss_close()/oss_mixer_close() */ + if (fd >= 0) { + return 1; + } else { + PyErr_SetString(PyExc_ValueError, + "Operation on closed OSS device."); + return 0; + } +} + /* _do_ioctl_1() is a private helper function used for the OSS ioctls -- - SNDCTL_DSP_{SETFMT,CHANNELS,SPEED} -- that that are called from C + SNDCTL_DSP_{SETFMT,CHANNELS,SPEED} -- that are called from C like this: ioctl(fd, SNDCTL_DSP_cmd, &arg)