Return a BZ error code over the wire when memory cannot be allocated,
since ENOMEM is not a portable wire error code.
Use BZIO for these errors to be consistent with the existing bosserver
code added in commit
fda2bc874751ca479365dc6389c0eebb41a0bda1 (Allocate
pathname buffers dynamically).
The incorrect error codes were added in:
fda2bc874751ca479365dc6389c0eebb41a0bda1 Allocate pathname buffers dynamically
381597851b659f00747b22efc24240073c4403ce bozo: Fix problems found by static analysis
Change-Id: I6e19aba226441159ba9e7d4173d2145f5d6745c2
Reviewed-on: https://gerrit.openafs.org/15030
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
return BZNOENT;
}
if (asprintf(&fpNew, "%s.NEW", filepath) < 0) {
- ret = ENOMEM;
+ ret = BZIO;
fpNew = NULL;
goto out;
}
tbuffer = malloc(AFSDIR_PATH_MAX);
if (tbuffer == NULL) {
- ret = ENOMEM;
+ ret = BZIO;
goto out;
}
if (code == 0) {
*aname = strdup(tname);
if (*aname == NULL)
- code = ENOMEM;
+ code = BZIO;
}
return code;