Close the file descriptor in the same method that had been opened.

MD-20923
This commit is contained in:
Carles Pina 2014-11-20 15:36:14 +00:00
parent 55f8918641
commit c24408d255

View file

@ -37,7 +37,6 @@ UpdateDialogGtk* (*update_dialog_gtk_new)() = 0;
bool extractFileFromBinary(int fd, const void* buffer, size_t length) bool extractFileFromBinary(int fd, const void* buffer, size_t length)
{ {
size_t count = write(fd,buffer,length); size_t count = write(fd,buffer,length);
close(fd);
return count >= length; return count >= length;
} }
@ -58,6 +57,7 @@ UpdateDialog* UpdateDialogGtkFactory::createDialog()
LOG(Warn,"Failed to load the GTK UI library - " + std::string(strerror(errno))); LOG(Warn,"Failed to load the GTK UI library - " + std::string(strerror(errno)));
return 0; return 0;
} }
close(libFd);
void* gtkLib = dlopen(libPath,RTLD_LAZY); void* gtkLib = dlopen(libPath,RTLD_LAZY);
if (!gtkLib) if (!gtkLib)