diff options
| author | Matthew T Vaught <mtvaught@us.ibm.com> | 2017-11-14 09:24:15 -0600 |
|---|---|---|
| committer | Matthew T Vaught <mtvaught@us.ibm.com> | 2017-11-14 09:24:15 -0600 |
| commit | ca02292fbd435a17800e7048c6010b81519859cb (patch) | |
| tree | d63ca6219d645d284cd079532eaabc7bd4bc6ff9 /src | |
| parent | 9942e2bf3477d48950a1bc2d922de79859152373 (diff) | |
| download | sb-signing-framework-ca02292fbd435a17800e7048c6010b81519859cb.tar.gz sb-signing-framework-ca02292fbd435a17800e7048c6010b81519859cb.zip | |
Resolved issues when building on AIX
Needed to include strings.h for bzero
Cannot use stdout as a variable name
Use gethostname instead of getenv("HOSTNAME")
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/client.c | 20 | ||||
| -rw-r--r-- | src/client/pscp_sftp.c | 1 |
2 files changed, 14 insertions, 7 deletions
diff --git a/src/client/client.c b/src/client/client.c index 894bde3..0eed1c3 100644 --- a/src/client/client.c +++ b/src/client/client.c @@ -95,7 +95,13 @@ int main(int argc, char** argv) if(success) { const char * username = getenv("USER"); - const char * hostname = getenv("HOSTNAME"); + char hostname_tmp[256]; + int hostname_status = gethostname(hostname_tmp, 256); + char* hostname = NULL; + if(hostname_status == 0) + { + hostname = hostname_tmp; + } const char * nullString = "NULL"; // Used if no username or hostname is found size_t identifierMaxSize = strlen(username) @@ -372,11 +378,11 @@ int main(int argc, char** argv) { int retval = 0; unsigned char* payload = NULL; - char* stdout = NULL; + char* output_str = NULL; size_t payload_len = 0; - size_t stdout_len = 0; + size_t output_str_len = 0; - status = parseServerResponse(pscp_response_filename, &payload, &payload_len, &stdout, &stdout_len, &retval, verbose); + status = parseServerResponse(pscp_response_filename, &payload, &payload_len, &output_str, &output_str_len, &retval, verbose); if(status == 0) { status = retval; @@ -410,13 +416,13 @@ int main(int argc, char** argv) free(payload); payload = NULL; } - if(stdout) + if(output_str) { if(pscp_print_server_stdout) { - printf("\n==== Begin Standard Out ====\n%s\n==== End of Standard Out ====\n", stdout); + printf("\n==== Begin Standard Out ====\n%s\n==== End of Standard Out ====\n", output_str); } - free(stdout); + free(output_str); } if(retval != 0) { diff --git a/src/client/pscp_sftp.c b/src/client/pscp_sftp.c index aede734..7a41945 100644 --- a/src/client/pscp_sftp.c +++ b/src/client/pscp_sftp.c @@ -18,6 +18,7 @@ #include <stdlib.h> #include <string.h> +#include <strings.h> #include <stdbool.h> #include <unistd.h> #include <signal.h> |

