1 |
Hello! |
2 |
|
3 |
On Sunday, 26. Juni 2016, 18:05:26 CEST wrote Mr. Dan Johansson: |
4 |
> The following code snippet compiles find but when run it just hangs forever |
5 |
|
6 |
I compiled it (after simpel copy’n’paste) and run it at x86 and and Raspberry |
7 |
Pi first gen (B+). Hung nowhere. |
8 |
|
9 |
> |
10 |
> $ cat x.c |
11 |
> #include <stdio.h> |
12 |
> #include <unistd.h> |
13 |
> #include <crypt.h> |
14 |
> |
15 |
> int main() { |
16 |
> printf("Running test\n"); |
17 |
> char *encrypted = crypt("blablabla","ab"); |
18 |
> if(!encrypted || strcmp(encrypted,"ab.h7fshjf89f")) { |
19 |
> printf("Fail\n"); |
20 |
> } else { |
21 |
> printf("OK\n"); |
22 |
> } |
23 |
> } |
24 |
> |
25 |
> $ gcc -o xout x.c -lcrypt |
26 |
> |
27 |
> $ ./xout |
28 |
> Running test |
29 |
> |
30 |
> <here the program just hangs and needs to be killed with ^C> |
31 |
> |
32 |
> The same code runs fine on my desktop. |
33 |
> Any suggestions what could be my problem? |
34 |
|
35 |
=> My output at ~amd64 and Raspberry Pi (~arm) was: |
36 |
======================= |
37 |
fancy_user @ fancy_gentoo_host$ ./xout |
38 |
Running test |
39 |
Fail |
40 |
======================= |
41 |
Maybe a strace (with dev-util/strace) tells you more (just a guess). |
42 |
If I can help with more specific informations and/or tests feel free to ask :) |
43 |
|
44 |
|
45 |
Greetings,, |
46 |
Nils |