Date: 05/30/98
- Next message: rasmus: "[PHP-DEV] CVS update: php3/functions"
- Previous message: Bug Database: "[PHP-DEV] Bug #419 Updated: fsockopen() doesn't return meaningful error codes"
- In reply to: rasmus: "[PHP-DEV] CVS update: php3/doc/functions"
- Next in thread: Shane Caraveo: "[PHP-DEV] Interesting thread problem in windows..."
- Reply: Shane Caraveo: "[PHP-DEV] Interesting thread problem in windows..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
rasmus <php-dev <email protected>> writes:
> Modified Files:
> network.sgml
> Log Message:
> Clean up return code from fsockopen() and add two optional arguments.
> $errno and $errstr which get set to the system-level errno and strerror()
> from the connect() call.
Super!
I think this is needed though, since you won't want to free() the
value returned by strerror():
Index: functions/fsock.c
===================================================================
RCS file: /repository/php3/functions/fsock.c,v
retrieving revision 1.72
diff -u -r1.72 fsock.c
--- fsock.c 1998/05/30 22:17:48 1.72
+++ fsock.c 1998/05/30 22:49:05
@@ -160,7 +160,7 @@
FREE_SOCK;
if(arg_count>2) args[2]->value.lval = errno;
if(arg_count>3) {
- args[3]->value.str.val = strerror(errno);
+ args[3]->value.str.val = estrdup(strerror(errno));
args[3]->value.str.len = strlen(args[3]->value.str.val);
}
RETURN_FALSE;
- Next message: rasmus: "[PHP-DEV] CVS update: php3/functions"
- Previous message: Bug Database: "[PHP-DEV] Bug #419 Updated: fsockopen() doesn't return meaningful error codes"
- In reply to: rasmus: "[PHP-DEV] CVS update: php3/doc/functions"
- Next in thread: Shane Caraveo: "[PHP-DEV] Interesting thread problem in windows..."
- Reply: Shane Caraveo: "[PHP-DEV] Interesting thread problem in windows..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

