diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libtrace/libtrace.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/libtrace/libtrace.c b/src/libtrace/libtrace.c index edd409af5..0e6e6c83d 100644 --- a/src/libtrace/libtrace.c +++ b/src/libtrace/libtrace.c | |||
@@ -500,11 +500,15 @@ int socket(int domain, int type, int protocol) { | |||
500 | else | 500 | else |
501 | ptr += sprintf(ptr, "%s ", str); | 501 | ptr += sprintf(ptr, "%s ", str); |
502 | 502 | ||
503 | str = translate(socket_protocol, protocol); | 503 | if (domain == AF_LOCAL) |
504 | if (str == NULL) | 504 | sprintf(ptr, "0"); |
505 | sprintf(ptr, "%d", protocol); | 505 | else { |
506 | else | 506 | str = translate(socket_protocol, protocol); |
507 | sprintf(ptr, "%s", str); | 507 | if (str == NULL) |
508 | sprintf(ptr, "%d", protocol); | ||
509 | else | ||
510 | sprintf(ptr, "%s", str); | ||
511 | } | ||
508 | 512 | ||
509 | printf("%s:%d\n", buf, rv); | 513 | printf("%s:%d\n", buf, rv); |
510 | return rv; | 514 | return rv; |