Commit 88e48ac97a8752c47f697d2f8d6fe420e8dda077
1 parent
1fdad013
Exists in
master
and in
5 other branches
Correcoes na interface HLLAPI
Showing
3 changed files
with
16 additions
and
22 deletions
Show diff stats
po/pt_BR.po
| ... | ... | @@ -5,7 +5,7 @@ msgid "" |
| 5 | 5 | msgstr "" |
| 6 | 6 | "Project-Id-Version: pw3270 5.0\n" |
| 7 | 7 | "Report-Msgid-Bugs-To: \n" |
| 8 | -"POT-Creation-Date: 2012-09-19 09:13-0300\n" | |
| 8 | +"POT-Creation-Date: 2012-09-20 09:55-0300\n" | |
| 9 | 9 | "PO-Revision-Date: 2012-09-14 14:32-0300\n" |
| 10 | 10 | "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" |
| 11 | 11 | "Language-Team: Português <perry.werneck@gmail.com>\n" |
| ... | ... | @@ -128,7 +128,7 @@ msgstr "Não foi possível conectar a %s:%d" |
| 128 | 128 | msgid "Can't connect to host" |
| 129 | 129 | msgstr "Não foi possível conectar ao servidor" |
| 130 | 130 | |
| 131 | -#: selection.c:603 | |
| 131 | +#: selection.c:601 | |
| 132 | 132 | msgid "Can't cut rectangular regions" |
| 133 | 133 | msgstr "Recortar não permitido em seleção retangular" |
| 134 | 134 | |
| ... | ... | @@ -417,7 +417,7 @@ msgstr "Invalid CGCSGID '%s', ignoring" |
| 417 | 417 | msgid "Invalid charset entry '%s' (#%d)" |
| 418 | 418 | msgstr "Invalid charset entry '%s' (#%d)" |
| 419 | 419 | |
| 420 | -#: selection.c:603 | |
| 420 | +#: selection.c:601 | |
| 421 | 421 | msgid "Invalid cut action" |
| 422 | 422 | msgstr "Ação recortar inválida" |
| 423 | 423 | |
| ... | ... | @@ -474,7 +474,7 @@ msgstr "Erro ao iniciar a rede" |
| 474 | 474 | msgid "Next field" |
| 475 | 475 | msgstr "Próximo campo" |
| 476 | 476 | |
| 477 | -#: selection.c:603 | |
| 477 | +#: selection.c:601 | |
| 478 | 478 | msgid "Not available" |
| 479 | 479 | msgstr "Não disponível" |
| 480 | 480 | ... | ... |
src/plugins/remotectl/hllapi.c
| ... | ... | @@ -58,7 +58,7 @@ |
| 58 | 58 | snprintf(PipeName,4095,"\\\\.\\pipe\\%s",name); |
| 59 | 59 | |
| 60 | 60 | if(!WaitNamedPipe(PipeName,NMPWAIT_USE_DEFAULT_WAIT)) |
| 61 | - return ETIMEDOUT; | |
| 61 | + return ENOENT; | |
| 62 | 62 | |
| 63 | 63 | hPipe = CreateFile(PipeName,GENERIC_WRITE|GENERIC_READ,0,NULL,OPEN_EXISTING,0,NULL); |
| 64 | 64 | |
| ... | ... | @@ -90,8 +90,7 @@ |
| 90 | 90 | |
| 91 | 91 | if(hPipe == INVALID_HANDLE_VALUE) |
| 92 | 92 | { |
| 93 | - trace("Invalid pipe handle %ld",(unsigned long) hPipe); | |
| 94 | - result = EPERM; | |
| 93 | + *rc = result = EPERM; | |
| 95 | 94 | } |
| 96 | 95 | else |
| 97 | 96 | { |
| ... | ... | @@ -116,7 +115,7 @@ |
| 116 | 115 | memset(buffer,0,HLLAPI_MAXLENGTH); |
| 117 | 116 | if(!TransactNamedPipe(hPipe,(LPVOID) data,cbSize,buffer,HLLAPI_MAXLENGTH,&cbSize,NULL)) |
| 118 | 117 | { |
| 119 | - result = GetLastError(); | |
| 118 | + *rc = result = GetLastError(); | |
| 120 | 119 | } |
| 121 | 120 | else |
| 122 | 121 | { |
| ... | ... | @@ -124,8 +123,6 @@ |
| 124 | 123 | |
| 125 | 124 | *rc = buffer->rc; |
| 126 | 125 | |
| 127 | - trace("%s: Query rc=%d",__FUNCTION__,(int) buffer->rc); | |
| 128 | - | |
| 129 | 126 | if(string && sz > 0) |
| 130 | 127 | memcpy(string,buffer->string,sz); |
| 131 | 128 | |
| ... | ... | @@ -155,7 +152,7 @@ |
| 155 | 152 | char * arg; |
| 156 | 153 | |
| 157 | 154 | if(!length || *length > HLLAPI_MAXLENGTH) |
| 158 | - return EINVAL; | |
| 155 | + return *rc = EINVAL; | |
| 159 | 156 | |
| 160 | 157 | if(length > 0) |
| 161 | 158 | { |
| ... | ... | @@ -169,16 +166,10 @@ |
| 169 | 166 | *arg = 0; |
| 170 | 167 | } |
| 171 | 168 | |
| 172 | -/* | |
| 173 | -#ifdef DEBUG | |
| 174 | - freopen("hllapi.log","a",stderr); | |
| 175 | -#endif // DEBUG | |
| 176 | -*/ | |
| 177 | - | |
| 178 | 169 | switch(*func) |
| 179 | 170 | { |
| 180 | 171 | case HLLAPI_CMD_CONNECTPS: |
| 181 | - result = cmd_connect_ps(arg); | |
| 172 | + *rc = result = cmd_connect_ps(arg); | |
| 182 | 173 | if(!result) |
| 183 | 174 | { |
| 184 | 175 | result = run_query(*func, arg, str, *length, rc); |
| ... | ... | @@ -189,13 +180,17 @@ |
| 189 | 180 | hPipe = INVALID_HANDLE_VALUE; |
| 190 | 181 | } |
| 191 | 182 | } |
| 183 | + else | |
| 184 | + { | |
| 185 | + *rc = result; | |
| 186 | + } | |
| 192 | 187 | break; |
| 193 | 188 | |
| 194 | 189 | case HLLAPI_CMD_DISCONNECTPS: |
| 195 | 190 | #ifdef WIN32 |
| 196 | 191 | if(hPipe == INVALID_HANDLE_VALUE) |
| 197 | 192 | { |
| 198 | - result = EINVAL; | |
| 193 | + *rc = result = EINVAL; | |
| 199 | 194 | } |
| 200 | 195 | else |
| 201 | 196 | { | ... | ... |
src/plugins/remotectl/testprogram.c
| ... | ... | @@ -64,7 +64,7 @@ |
| 64 | 64 | len = BUFFER_LENGTH; |
| 65 | 65 | strcpy(buffer,cmd[f].arg); |
| 66 | 66 | result = hllapi(&cmd[f].fn,buffer,&len,&rc); |
| 67 | - printf("%s exits with %d\n[%s]\n",cmd[f].name,result,buffer); | |
| 67 | + printf("%s exits with result=%d rc=%d\n[%s]\n",cmd[f].name,result,rc,buffer); | |
| 68 | 68 | |
| 69 | 69 | } |
| 70 | 70 | |
| ... | ... | @@ -72,8 +72,7 @@ |
| 72 | 72 | rc = 1; |
| 73 | 73 | fn = HLLAPI_CMD_COPYPSTOSTR; |
| 74 | 74 | result = hllapi(&fn,buffer,&len,&rc); |
| 75 | - printf("%s exits with %d\n%s\n","HLLAPI_CMD_COPYPSTOSTR",result,buffer); | |
| 76 | - | |
| 75 | + printf("%s exits with result=%d rc=%d\n%s\n","HLLAPI_CMD_COPYPSTOSTR",result,rc,buffer); | |
| 77 | 76 | |
| 78 | 77 | // Disconnect |
| 79 | 78 | len = BUFFER_LENGTH; | ... | ... |