@@ -754,11 +754,11 @@ check_for_support_lib(ClusterInfo *cluster)
754
754
755
755
snprintf (cmd , sizeof (cmd ), "\"%s/pg_config\" --pkglibdir" , cluster -> bindir );
756
756
757
- if ((output = popen (cmd , "r" )) == NULL )
758
- pg_log (PG_FATAL , "Could not get pkglibdir data: %s\n" ,
759
- getErrorText (errno ));
757
+ if ((output = popen (cmd , "r" )) == NULL ||
758
+ fgets (libdir , sizeof (libdir ), output ) == NULL )
759
+ pg_log (PG_FATAL , "Could not get pkglibdir data using %s: %s\n" ,
760
+ cmd , getErrorText (errno ));
760
761
761
- fgets (libdir , sizeof (libdir ), output );
762
762
763
763
pclose (output );
764
764
@@ -787,11 +787,10 @@ get_bin_version(ClusterInfo *cluster)
787
787
788
788
snprintf (cmd , sizeof (cmd ), "\"%s/pg_ctl\" --version" , cluster -> bindir );
789
789
790
- if ((output = popen (cmd , "r" )) == NULL )
791
- pg_log (PG_FATAL , "Could not get pg_ctl version data: %s\n" ,
792
- getErrorText (errno ));
793
-
794
- fgets (cmd_output , sizeof (cmd_output ), output );
790
+ if ((output = popen (cmd , "r" )) == NULL ||
791
+ fgets (cmd_output , sizeof (cmd_output ), output ) == NULL )
792
+ pg_log (PG_FATAL , "Could not get pg_ctl version data using %s: %s\n" ,
793
+ cmd , getErrorText (errno ));
795
794
796
795
pclose (output );
797
796
0 commit comments