From 6d7bff2476459049f4f554291a680e0f6003ea66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 7 Jun 2015 21:10:18 +0200 Subject: GH-1060 remove updater code --- mmc_updater/src/UpdateDialogGtkFactory.cpp | 59 ------------------------------ 1 file changed, 59 deletions(-) delete mode 100644 mmc_updater/src/UpdateDialogGtkFactory.cpp (limited to 'mmc_updater/src/UpdateDialogGtkFactory.cpp') diff --git a/mmc_updater/src/UpdateDialogGtkFactory.cpp b/mmc_updater/src/UpdateDialogGtkFactory.cpp deleted file mode 100644 index 313da31a..00000000 --- a/mmc_updater/src/UpdateDialogGtkFactory.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include "UpdateDialogGtkFactory.h" - -#include "Log.h" -#include "UpdateDialog.h" -#include "StringUtils.h" - -#include -#include -#include -#include -#include -#include - -class UpdateDialogGtk; - -// GTK updater UI library embedded into -// the updater binary -extern unsigned char libupdatergtk_so[]; -extern unsigned int libupdatergtk_so_len; - -// pointers to helper functions in the GTK updater UI library -UpdateDialogGtk* (*update_dialog_gtk_new)() = 0; - -bool extractFileFromBinary(const char* path, const void* buffer, size_t length) -{ - int fd = open(path,O_CREAT | O_WRONLY | O_TRUNC,0755); - size_t count = write(fd,buffer,length); - if (fd < 0 || count < length) - { - if (fd >= 0) - { - close(fd); - } - return false; - } - close(fd); - return true; -} - -UpdateDialog* UpdateDialogGtkFactory::createDialog() -{ - const char* libPath = "/tmp/libupdatergtk.so"; - - if (!extractFileFromBinary(libPath,libupdatergtk_so,libupdatergtk_so_len)) - { - LOG(Warn,"Failed to load the GTK UI library - " + std::string(strerror(errno))); - return 0; - } - - void* gtkLib = dlopen(libPath,RTLD_LAZY); - if (!gtkLib) - { - LOG(Warn,"Failed to load the GTK UI - " + std::string(dlerror())); - return 0; - } - update_dialog_gtk_new = (UpdateDialogGtk* (*)()) dlsym(gtkLib,"update_dialog_gtk_new"); - return reinterpret_cast(update_dialog_gtk_new()); -} - -- cgit v1.2.3