Simple fix for Tooltalk coredump

PR:		ports/221102
Submitted by:	mikael.urankar@gmail.com
This commit is contained in:
Chris Rees 2017-07-31 22:03:45 +00:00
parent a13a6a92ad
commit 755f66e223
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=447001
2 changed files with 24 additions and 0 deletions

View file

@ -2,6 +2,7 @@
PORTNAME= cde
DISTVERSION= 2.2.3
PORTREVISION= 1
CATEGORIES= x11-wm
MASTER_SITES= SF/cdesktopenv/src/
DISTNAME= ${PORTNAME}-src-${DISTVERSION}

View file

@ -0,0 +1,23 @@
--- lib/tt/lib/util/tt_file_system.C 2016-06-19 20:46:29 UTC
+++ lib/tt/lib/util/tt_file_system.C
@@ -46,6 +46,7 @@
#include <stdio.h>
#include <string.h>
+#include <errno.h>
#if defined(linux)
# include <sys/poll.h>
#else
@@ -516,7 +517,11 @@ updateFileSystemEntries ()
int flags = MNT_NOWAIT;
char *s, *host, path[MNAMELEN] ;
- numfs = getfsstat ( (struct statfs *)0, 0, 0 );
+ numfs = getfsstat ( (struct statfs *)0, 0, flags );
+ if(numfs == (-1)){
+ _tt_syslog(0,LOG_ERR,"getfsstat: %s",strerror(errno));
+ exit(EXIT_FAILURE);
+ }
bufsize = numfs * sizeof ( struct statfs );
buf = (struct statfs *) malloc ( bufsize );