| 2951 | } |
| 2952 | |
| 2953 | static void |
| 2954 | WriteInternalConfFile(void) |
| 2955 | { |
| 2956 | char filename[MAXPGPATH]; |
| 2957 | FILE *cf; |
| 2958 | char line_to_write[100]; |
| 2959 | int length; |
| 2960 | |
| 2961 | sprintf(filename, "%s/%s", basedir, GP_INTERNAL_AUTO_CONF_FILE_NAME); |
| 2962 | |
| 2963 | cf = fopen(filename, "w"); |
| 2964 | if (cf == NULL) |
| 2965 | { |
| 2966 | pg_log_error("could not create file \"%s\": %m", filename); |
| 2967 | exit(1); |
| 2968 | } |
| 2969 | |
| 2970 | length = snprintf(line_to_write, 100, "gp_dbid=%d\n", target_gp_dbid); |
| 2971 | |
| 2972 | if (fwrite(line_to_write, length, 1, cf) != 1) |
| 2973 | { |
| 2974 | pg_log_error("could not write to file \"%s\": %m", filename); |
| 2975 | exit(1); |
| 2976 | } |
| 2977 | |
| 2978 | fclose(cf); |
| 2979 | } |
no outgoing calls
no test coverage detected