Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 34040 Details for
Bug 54993
Fixed ebuild for gsmlib-1.10
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
gsmlib-1.10-fd-leak-fix.patch
gsmlib-1.10-fd-leak-fix.patch (text/plain), 2.26 KB, created by
Zach Bagnall
on 2004-06-24 02:54:36 UTC
(
hide
)
Description:
gsmlib-1.10-fd-leak-fix.patch
Filename:
MIME Type:
Creator:
Zach Bagnall
Created:
2004-06-24 02:54:36 UTC
Size:
2.26 KB
patch
obsolete
>--- tmp/gsmlib-1.9/gsmlib/gsm_unix_serial.cc 2001-07-15 11:00:36.000000000 +0100 >+++ /home/fez/edmundd/gsm_unix_serial.cc 2002-11-09 21:59:01.000000000 +0000 >@@ -178,11 +178,15 @@ > > // switch off non-blocking mode > int fdFlags; >- if ((fdFlags = fcntl(_fd, F_GETFL)) == -1) >+ if ((fdFlags = fcntl(_fd, F_GETFL)) == -1) { >+ close(_fd); > throwModemException(_("getting file status flags failed")); >+ } > fdFlags &= ~O_NONBLOCK; >- if (fcntl(_fd, F_SETFL, fdFlags) == -1) >+ if (fcntl(_fd, F_SETFL, fdFlags) == -1) { >+ close(_fd); > throwModemException(_("switching of non-blocking mode failed")); >+ } > > long int saveTimeoutVal = _timeoutVal; > _timeoutVal = 3; >@@ -194,17 +198,22 @@ > > // toggle DTR to reset modem > int mctl = TIOCM_DTR; >- if (ioctl(_fd, TIOCMBIC, &mctl) < 0) >+ if (ioctl(_fd, TIOCMBIC, &mctl) < 0) { >+ close(_fd); > throwModemException(_("clearing DTR failed")); >+ } > // the waiting time for DTR toggling is increased with each loop > usleep(holdoff[initTries]); >- if (ioctl(_fd, TIOCMBIS, &mctl) < 0) >+ if (ioctl(_fd, TIOCMBIS, &mctl) < 0) { >+ close(_fd); > throwModemException(_("setting DTR failed")); >- >+ } > // get line modes >- if (tcgetattr(_fd, &t) < 0) >+ if (tcgetattr(_fd, &t) < 0) { >+ close(_fd); > throwModemException(stringPrintf(_("tcgetattr device '%s'"), > device.c_str())); >+ } > > // set line speed > cfsetispeed(&t, lineSpeed); >@@ -229,9 +238,11 @@ > t.c_cc[VSUSP] = 0; > > // write back >- if(tcsetattr (_fd, TCSANOW, &t) < 0) >+ if(tcsetattr (_fd, TCSANOW, &t) < 0) { >+ close(_fd); > throwModemException(stringPrintf(_("tcsetattr device '%s'"), > device.c_str())); >+ } > // the waiting time for writing to the ME/TA is increased with each loop > usleep(holdoff[initTries]); > >@@ -277,11 +288,14 @@ > catch (GsmException &e) > { > _timeoutVal = saveTimeoutVal; >- if (initTries == 0) >+ if (initTries == 0) { >+ close(_fd); > throw e; >+ } > } > } > // no response after 3 tries >+ close(_fd); > throw GsmException(stringPrintf(_("reset modem failed '%s'"), > device.c_str()), OtherError); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 54993
:
34038
|
34039
| 34040