Commit c20996f567c52903a1f1622b8d9e6182322a734e
1 parent
17888141
Exists in
master
and in
1 other branch
Working on IPC module for windows.
Showing
3 changed files
with
5 additions
and
4 deletions
Show diff stats
src/service/service.c
| @@ -122,10 +122,12 @@ int main(int argc, char *argv[]) { | @@ -122,10 +122,12 @@ int main(int argc, char *argv[]) { | ||
| 122 | return -1; | 122 | return -1; |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | +#ifndef _WIN32 | ||
| 125 | if(asDaemon && daemon(0,0)) { | 126 | if(asDaemon && daemon(0,0)) { |
| 126 | fprintf(stderr,"%s\n",strerror(errno)); | 127 | fprintf(stderr,"%s\n",strerror(errno)); |
| 127 | return -1; | 128 | return -1; |
| 128 | } | 129 | } |
| 130 | +#endif // _WIN32 | ||
| 129 | 131 | ||
| 130 | main_loop = g_main_loop_new(NULL, FALSE); | 132 | main_loop = g_main_loop_new(NULL, FALSE); |
| 131 | g_main_loop_run(main_loop); | 133 | g_main_loop_run(main_loop); |
src/windows/gobject.c
| @@ -97,12 +97,11 @@ void ipc3270_set_session(GObject *object, H3270 *hSession, const char *name, GEr | @@ -97,12 +97,11 @@ void ipc3270_set_session(GObject *object, H3270 *hSession, const char *name, GEr | ||
| 97 | 97 | ||
| 98 | if(hPipe != INVALID_HANDLE_VALUE) { | 98 | if(hPipe != INVALID_HANDLE_VALUE) { |
| 99 | 99 | ||
| 100 | - ipc->source = (IPC3270_PIPE_SOURCE *) g_source_new(&pipe_source_funcs,sizeof(IPC3270_PIPE_SOURCE)); | 100 | + ipc->source = (IPC3270_PIPE_SOURCE *) g_source_new(&ipc3270_source_funcs,sizeof(IPC3270_PIPE_SOURCE)); |
| 101 | 101 | ||
| 102 | lib3270_set_session_id(ipc->hSession, id); | 102 | lib3270_set_session_id(ipc->hSession, id); |
| 103 | 103 | ||
| 104 | ipc->source->hPipe = hPipe; | 104 | ipc->source->hPipe = hPipe; |
| 105 | - ipc->source->hSession = hSession; | ||
| 106 | ipc->source->state = PIPE_STATE_WAITING; | 105 | ipc->source->state = PIPE_STATE_WAITING; |
| 107 | ipc->source->overlap.hEvent = CreateEvent( NULL,TRUE,TRUE,NULL); | 106 | ipc->source->overlap.hEvent = CreateEvent( NULL,TRUE,TRUE,NULL); |
| 108 | 107 |
src/windows/pipesource.c
| @@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
| 32 | void ipc3270_wait_for_client(IPC3270_PIPE_SOURCE *source) { | 32 | void ipc3270_wait_for_client(IPC3270_PIPE_SOURCE *source) { |
| 33 | 33 | ||
| 34 | if(ConnectNamedPipe(source->hPipe,&source->overlap)) { | 34 | if(ConnectNamedPipe(source->hPipe,&source->overlap)) { |
| 35 | - g_message("Error %u in ConnectNamedPipe",(unsigned int) getLastError()); | 35 | + g_message("Error %u in ConnectNamedPipe",(unsigned int) GetLastError()); |
| 36 | // popup_lasterror("%s",_( "Error in ConnectNamedPipe" )); | 36 | // popup_lasterror("%s",_( "Error in ConnectNamedPipe" )); |
| 37 | return; | 37 | return; |
| 38 | } | 38 | } |
| @@ -48,7 +48,7 @@ void ipc3270_wait_for_client(IPC3270_PIPE_SOURCE *source) { | @@ -48,7 +48,7 @@ void ipc3270_wait_for_client(IPC3270_PIPE_SOURCE *source) { | ||
| 48 | break; | 48 | break; |
| 49 | 49 | ||
| 50 | default: | 50 | default: |
| 51 | - g_message("Error %u in ConnectNamedPipe",(unsigned int) getLastError()); | 51 | + g_message("Error %u in ConnectNamedPipe",(unsigned int) GetLastError()); |
| 52 | // popup_lasterror("%s", _( "ConnectNamedPipe failed" )); | 52 | // popup_lasterror("%s", _( "ConnectNamedPipe failed" )); |
| 53 | } | 53 | } |
| 54 | 54 |