-
Notifications
You must be signed in to change notification settings - Fork 76
Added support for fifos and sockets (#42) #204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
375bfed
65a62aa
a1cad0f
0f1f759
2bf8a53
e3bc7fa
98bc6dc
abe8f9d
e62bf80
9ecca5b
6e0c845
fbefc3f
21ec4a5
0144546
a22c784
6854cc2
635d883
4911a8a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,21 +10,21 @@ AC_ARG_ENABLE([utils], | |
| [don't compile C utilities for summarizing and committing changes (default is yes)])], | ||
| [enable_utils=${enableval}], [enable_utils=yes]) | ||
|
|
||
|
|
||
| AC_REQUIRE_AUX_FILE([utils/make-socket.c]) | ||
|
|
||
| # build tools | ||
| AC_PROG_CC | ||
|
|
||
| # CFLAGS AND CPPFLAGGS | ||
| AUTO_CFLAGS="" | ||
| AUTO_CPPFLAGS="" | ||
|
|
||
| if test "$enable_utils" = "yes" | ||
| then | ||
| AC_REQUIRE_AUX_FILE([utils/try-commit.c]) | ||
|
|
||
| # build tools | ||
| AC_PROG_CC | ||
|
|
||
| # CFLAGS and CPPFLAGGS | ||
| if test -z "$CFLAGS" | ||
| then | ||
| AUTO_CFLAGS="-g -Wall -O2" | ||
| else | ||
| AUTO_CFLAGS="" | ||
| fi | ||
| AUTO_CPPFLAGS="" | ||
| AUTO_CPPFLAGS="" | ||
|
|
||
| CFLAGS=${CFLAGS-"$AUTO_CFLAGS"} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These lines need to be moved up, so that we're actually setting CFLAGS and CPPFLAGS! |
||
| CPPFLAGS=${CPPFLAGS-"$AUTO_CPPFLAGS"} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -224,3 +224,90 @@ echo arrivederci >formerdir/it/file2 || fail | |
| [ -L formerdir ] || fail | ||
| [ "$(readlink formerdir)" = "/this/is/a/broken/symlink" ] || fail | ||
| rm formerdir || fail | ||
|
|
||
| # // TRYCASE(fifo, file) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newpipe ] || fail | ||
| "$TRY" -y "touch newpipe; echo new >newpipe" | ||
| [ -f newpipe ] || fail | ||
| [ "$(cat newpipe)" = "new" ] || fail | ||
| "$TRY" -y "rm newpipe; mkfifo newpipe" | ||
| [ -p newpipe ] || fail | ||
| rm newpipe | ||
|
|
||
| # // TRYCASE(fifo, dir) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newpipe ] || fail | ||
| "$TRY" -y "mkdir newpipe" | ||
| [ -d newpipe ] || fail | ||
| "$TRY" -y "rm -r newpipe; mkfifo newpipe" | ||
| [ -p newpipe ] || fail | ||
| rm newpipe | ||
|
|
||
| # // TRYCASE(fifo, symlink) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newpipe ] || fail | ||
| ln -s "$TRY" newpipe | ||
| [ -L newpipe ] || fail | ||
| "$TRY" -y "rm newpipe; mkfifo newpipe" | ||
| [ -p newpipe ] || fail | ||
| rm newpipe | ||
|
|
||
| # // TRYCASE(fifo, nonexist) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newpipe ] || fail | ||
| "$TRY" -y "mkfifo newpipe" | ||
| [ -p newpipe ] || fail | ||
| rm newpipe | ||
|
|
||
| # // TRYCASE(socket, file) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newsock ] || fail | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not test the declared case. |
||
| "$TRY" -y "touch newsock; echo hello> newsock" | ||
| [ -f newsock ] || fail | ||
| [ "$(cat newsock)" = "hello" ] || fail | ||
| "$TRY" -y "rm newsock; make-socket newsock" | ||
| [ -S newsock ] || fail | ||
| rm newsock | ||
|
|
||
| # // TRYCASE(socket, dir) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newsock ] || fail | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not test the declared case. |
||
| "$TRY" -y "mkdir newsock" | ||
| [ -d newsock ] || fail | ||
| "$TRY" -y "rm -r newsock; make-socket newsock" | ||
| [ -S newsock ] || fail | ||
| rm newsock | ||
|
|
||
| # // TRYCASE(socket, symlink) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newsock ] || fail | ||
| ln -s "$TRY" newsock | ||
| [ -L newsock ] || fail | ||
| "$TRY" -y "rm newsock; make-socket newsock" | ||
| ! [ -e newlink ] || fail | ||
| [ -S newsock ] || fail | ||
| rm newsock | ||
|
|
||
| # // TRYCASE(socket, nonexist) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newsock ] | ||
| "$TRY" -y "make-socket newsock" | ||
| [ -S newsock ] || fail | ||
| rm newsock | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go now, since we've set it unconditionally above.