forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8e68816
committed
Be more robust when strerror() doesn't give a useful result.
glibc, at least, is capable of returning "???" instead of anything usefulif it doesn't like the setting of LC_CTYPE. If this happens, or in thepreviously-known case of strerror() returning an empty string, try toprint the C macro name for the error code ("EACCES" etc). Only if wedon't have the error code in our compiled-in list of popular error codes(which covers most though not quite all of what's called out in the POSIXspec) will we fall back to printing a numeric error code. This shouldsimplify debugging.Note that this functionality is currently only provided for %m in backendereport/elog messages. That may be sufficient, since we don't fool with thelocale environment in frontend clients, but it's foreseeable that we mightwant similar code in libpq for instance.There was some talk of back-patching this, but let's see how the buildfarmlikes it first. It seems likely that at least some of the POSIX-definederror code symbols don't exist on all platforms. I don't want to clutterthe entire list with #ifdefs, but we may need more than are here now.MauMau, edited by me1 parentbb45c64 commit8e68816
1 file changed
+157
-4
lines changedLines changed: 157 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
173 | 173 |
| |
174 | 174 |
| |
175 | 175 |
| |
| 176 | + | |
176 | 177 |
| |
177 | 178 |
| |
178 | 179 |
| |
| |||
3206 | 3207 |
| |
3207 | 3208 |
| |
3208 | 3209 |
| |
3209 |
| - | |
| 3210 | + | |
3210 | 3211 |
| |
3211 | 3212 |
| |
3212 | 3213 |
| |
| |||
3218 | 3219 |
| |
3219 | 3220 |
| |
3220 | 3221 |
| |
3221 |
| - | |
3222 |
| - | |
| 3222 | + | |
| 3223 | + | |
| 3224 | + | |
| 3225 | + | |
| 3226 | + | |
3223 | 3227 |
| |
3224 |
| - | |
| 3228 | + | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
3225 | 3232 |
| |
3226 | 3233 |
| |
3227 | 3234 |
| |
| |||
3234 | 3241 |
| |
3235 | 3242 |
| |
3236 | 3243 |
| |
| 3244 | + | |
| 3245 | + | |
| 3246 | + | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
| 3275 | + | |
| 3276 | + | |
| 3277 | + | |
| 3278 | + | |
| 3279 | + | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
| 3285 | + | |
| 3286 | + | |
| 3287 | + | |
| 3288 | + | |
| 3289 | + | |
| 3290 | + | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
| 3294 | + | |
| 3295 | + | |
| 3296 | + | |
| 3297 | + | |
| 3298 | + | |
| 3299 | + | |
| 3300 | + | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
| 3304 | + | |
| 3305 | + | |
| 3306 | + | |
| 3307 | + | |
| 3308 | + | |
| 3309 | + | |
| 3310 | + | |
| 3311 | + | |
| 3312 | + | |
| 3313 | + | |
| 3314 | + | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
| 3318 | + | |
| 3319 | + | |
| 3320 | + | |
| 3321 | + | |
| 3322 | + | |
| 3323 | + | |
| 3324 | + | |
| 3325 | + | |
| 3326 | + | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
| 3330 | + | |
| 3331 | + | |
| 3332 | + | |
| 3333 | + | |
| 3334 | + | |
| 3335 | + | |
| 3336 | + | |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
3237 | 3390 |
| |
3238 | 3391 |
| |
3239 | 3392 |
| |
|
0 commit comments
Comments
(0)