int free_x11display(x11display_t * x11disp) { int err; if (x11disp->idmap) { memblock_t mblock = memblock_INIT(sizeof(x11windowmap_t), (uint8_t*)x11disp->idmap); err = FREE_MM(&mblock); if ( x11disp->sys_display && XCloseDisplay(x11disp->sys_display)) { err = ECOMM; TRACESYSCALL_ERRLOG("XCloseDisplay", err); } x11disp->idmap = 0; x11disp->sys_display = 0; if (err) goto ONERR; } return 0 ; ONERR: TRACEEXITFREE_ERRLOG(err); return err; }
int free_pipe(pipe_t* pipe) { int err = 0; if (! isfree_iochannel(pipe->read)) { if (close(pipe->read)) { err = errno; } (void) PROCESS_testerrortimer(&s_pipe_errtimer, &err); pipe->read = sys_iochannel_FREE; } if (! isfree_iochannel(pipe->write)) { if (close(pipe->write)) { err = errno; } (void) PROCESS_testerrortimer(&s_pipe_errtimer, &err); pipe->write = sys_iochannel_FREE; } if (err) goto ONERR; return 0; ONERR: TRACEEXITFREE_ERRLOG(err); return err; }
int free_filereader(filereader_t * frd) { int err; int err2; frd->ioerror = 0; frd->unreadsize = 0; frd->nextindex = 0; frd->nrfreebuffer = 0; frd->fileoffset = 0; frd->filesize = 0; err = free_file(&frd->file); err2 = free_vmpage(cast_vmpage(&frd->page[0],)); if (err2) err = err2; err2 = free_vmpage(cast_vmpage(&frd->page[1],)); if (err2) err = err2; if (err) goto ONERR; return 0; ONERR: TRACEEXITFREE_ERRLOG(err); return err; }
int free_systimer(systimer_t * timer) { int err ; err = free_iochannel(timer) ; if (err) goto ONERR; return 0 ; ONERR: TRACEEXITFREE_ERRLOG(err); return err ; }
int free_module(module_t * mod) { int err; err = free_vmpage(cast_vmpage(mod, page_)); if (err) goto ONERR; mod->code_size = 0; return 0; ONERR: TRACEEXITFREE_ERRLOG(err); return err; }
int swapbuffer_eglwindow(eglwindow_t eglwin, egldisplay_t egldisp) { int err; if (EGL_FALSE == eglSwapBuffers(egldisp, eglwin)) { err = convert2errno_egl(eglGetError()); goto ONERR; } return 0; ONERR: TRACEEXITFREE_ERRLOG(err); return err; }
int free_syslogin(syslogin_t* syslogin) { int err; if (sys_userid_FREE != syslogin->realuser) { err = switchuser(syslogin, syslogin->privilegeduser); *syslogin = (syslogin_t) syslogin_FREE; if (err) goto ONERR; } return 0; ONERR: TRACEEXITFREE_ERRLOG(err); return err; }
int delete_syslogininfo(syslogin_info_t** info) { int err; syslogin_info_t* delobj = *info; if (delobj) { *info = 0; memblock_t mblock = memblock_INIT(delobj->size, (uint8_t*)delobj); err = FREE_MM(&mblock); if (err) goto ONERR; } return 0; ONERR: TRACEEXITFREE_ERRLOG(err); return err; }
int free_iothread(iothread_t* iothr) { int err; if (iothr->thread) { requeststop_iothread(iothr); (void) join_thread(iothr->thread); cancelall_iolist(&iothr->iolist); err = delete_thread(&iothr->thread); (void) PROCESS_testerrortimer(&s_iothread_errtimer, &err); if (err) goto ONERR; } return 0; ONERR: TRACEEXITFREE_ERRLOG(err); return err; }
int free_window(window_t * win) { int err; int err2; if (0 != display_window(win)) { err = FREE_GLWINDOW(&gl_window(win), display_window(win)); (void) PROCESS_testerrortimer(&s_window_errtimer, &err); err2 = FREE_OSWINDOW(os_window(win)); (void) PROCESS_testerrortimer(&s_window_errtimer, &err2); if (err2) err = err2; if (err) goto ONERR; } return 0; ONERR: TRACEEXITFREE_ERRLOG(err); return err; }
int free_logbuffer(logbuffer_t * logbuf) { int err; logbuf->addr = 0; logbuf->size = 0; logbuf->logsize = 0; if ( logbuf->io == iochannel_STDOUT || logbuf->io == iochannel_STDERR) { logbuf->io = iochannel_FREE; } else { err = free_iochannel(&logbuf->io); if (err) goto ONERR; } return 0; ONERR: TRACEEXITFREE_ERRLOG(err); return err; }
int free_eglwindow(eglwindow_t * eglwin, egldisplay_t egldisp) { int err; if (*eglwin) { EGLBoolean isDestoyed = eglDestroySurface(egldisp, *eglwin); *eglwin = 0; if (EGL_FALSE == isDestoyed) { err = convert2errno_egl(eglGetError()); goto ONERR; } if (PROCESS_testerrortimer(&s_eglwindow_errtimer, &err)) goto ONERR; } return 0; ONERR: TRACEEXITFREE_ERRLOG(err); return err; }