Mercurial > pidgin.yaz
view fix-casts.sh @ 32405:d3d41ba0c3b8
In our forked DNS resolver processes, don't bail out if we get a retryable
error while reading from our parent socket. I think EAGAIN and EWOULDBLOCK
never happen because this is a non-blocking socket AND because we're using
select (seems like we'd be fine using one or the other, and it's not necessary
to use both?). I believe this is correct behavior and we should be doing
this same thing everywhere we read from sockets. I think we probably don't
check for EINTR in many places where we should.
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 24 Aug 2011 17:54:39 +0000 |
parents | c3ca613ab550 |
children |
line wrap: on
line source
#!/bin/sh if [ $# -eq 0 ]; then echo "Usage: `basename "$0"` PurpleFoo..." echo echo "This script searches the *current working directory* and replaces casts" echo "with GObject-style type checking and casting macros." echo 'For example, "(PurpleBuddy *)b" becomes "PURPLE_BUDDY(b)".' exit 0 fi for struct in $* ; do cast=`echo $struct | sed "s|[A-Z]|_\0|g" | tr "a-z" "A-Z" | sed "s|^_||"` for file in `grep -rl "([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)" . --include=*.c --exclude=purple-client-bindings.c` ; do sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*(|$cast(|g" $file sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*\([^(][^,);]*\)|$cast(\1)|g" $file done done