Explorar o código

Rename process description function arguments to desc

Guillem Jover %!s(int64=16) %!d(string=hai) anos
pai
achega
4d35b20c64
Modificáronse 3 ficheiros con 22 adicións e 22 borrados
  1. 9 9
      lib/dpkg/subproc.c
  2. 10 10
      src/help.c
  3. 3 3
      src/main.h

+ 9 - 9
lib/dpkg/subproc.c

@@ -71,7 +71,7 @@ subproc_signals_cleanup(int argc, void **argv)
 }
 
 int
-subproc_check(int status, const char *description, int flags)
+subproc_check(int status, const char *desc, int flags)
 {
 	int n;
 
@@ -83,10 +83,10 @@ subproc_check(int status, const char *description, int flags)
 			return -1;
 		if (flags & PROCWARN)
 			warning(_("%s returned error exit status %d"),
-			        description, n);
+			        desc, n);
 		else
 			ohshit(_("subprocess %s returned error exit status %d"),
-			       description, n);
+			       desc, n);
 	} else if (WIFSIGNALED(status)) {
 		n = WTERMSIG(status);
 		if (!n)
@@ -95,22 +95,22 @@ subproc_check(int status, const char *description, int flags)
 			return 0;
 		if (flags & PROCWARN)
 			warning(_("%s killed by signal (%s)%s"),
-			        description, strsignal(n),
+			        desc, strsignal(n),
 			        WCOREDUMP(status) ? _(", core dumped") : "");
 		else
 			ohshit(_("subprocess %s killed by signal (%s)%s"),
-			       description, strsignal(n),
+			       desc, strsignal(n),
 			       WCOREDUMP(status) ? _(", core dumped") : "");
 	} else {
 		ohshit(_("subprocess %s failed with wait status code %d"),
-		       description, status);
+		       desc, status);
 	}
 
 	return -1;
 }
 
 int
-subproc_wait_check(pid_t pid, const char *description, int flags)
+subproc_wait_check(pid_t pid, const char *desc, int flags)
 {
 	pid_t r;
 	int status;
@@ -119,9 +119,9 @@ subproc_wait_check(pid_t pid, const char *description, int flags)
 
 	if (r != pid) {
 		onerr_abort++;
-		ohshite(_("wait for %s failed"), description);
+		ohshite(_("wait for %s failed"), desc);
 	}
 
-	return subproc_check(status, description, flags);
+	return subproc_check(status, desc, flags);
 }
 

+ 10 - 10
src/help.c

@@ -307,7 +307,7 @@ do_script(struct pkginfo *pkg, struct pkginfoperfile *pif,
 
 static int
 vmaintainer_script_installed(struct pkginfo *pkg, const char *scriptname,
-                             const char *description, va_list ap)
+                             const char *desc, va_list ap)
 {
   const char *scriptpath;
   char *const *arglist;
@@ -316,7 +316,7 @@ vmaintainer_script_installed(struct pkginfo *pkg, const char *scriptname,
 
   scriptpath= pkgadminfile(pkg,scriptname);
   arglist= vbuildarglist(scriptname,ap);
-  sprintf(buf, _("installed %s script"), description);
+  sprintf(buf, _("installed %s script"), desc);
 
   if (stat(scriptpath,&stab)) {
     if (errno == ENOENT) {
@@ -335,13 +335,13 @@ vmaintainer_script_installed(struct pkginfo *pkg, const char *scriptname,
 /* All ...'s are const char*'s. */
 int
 maintainer_script_installed(struct pkginfo *pkg, const char *scriptname,
-                            const char *description, ...)
+                            const char *desc, ...)
 {
   int r;
   va_list ap;
 
-  va_start(ap, description);
-  r = vmaintainer_script_installed(pkg, scriptname, description, ap);
+  va_start(ap, desc);
+  r = vmaintainer_script_installed(pkg, scriptname, desc, ap);
   va_end(ap);
   if (r)
     post_script_tasks();
@@ -366,7 +366,7 @@ maintainer_script_postinst(struct pkginfo *pkg, ...)
 
 int
 maintainer_script_new(struct pkginfo *pkg,
-                      const char *scriptname, const char *description,
+                      const char *scriptname, const char *desc,
                       const char *cidir, char *cidirrest, ...)
 {
   char *const *arglist;
@@ -377,7 +377,7 @@ maintainer_script_new(struct pkginfo *pkg,
   va_start(ap,cidirrest);
   arglist= vbuildarglist(scriptname,ap);
   va_end(ap);
-  sprintf(buf, _("new %s script"), description);
+  sprintf(buf, _("new %s script"), desc);
 
   strcpy(cidirrest,scriptname);
   if (stat(cidir,&stab)) {
@@ -395,7 +395,7 @@ maintainer_script_new(struct pkginfo *pkg,
 }
 
 int maintainer_script_alternative(struct pkginfo *pkg,
-                                  const char *scriptname, const char *description,
+                                  const char *scriptname, const char *desc,
                                   const char *cidir, char *cidirrest,
                                   const char *ifok, const char *iffallback) {
   const char *oldscriptpath;
@@ -408,7 +408,7 @@ int maintainer_script_alternative(struct pkginfo *pkg,
                         ifok,versiondescribe(&pkg->available.version,
                                              vdew_nonambig),
                         NULL);
-  sprintf(buf,_("old %s script"),description);
+  sprintf(buf, _("old %s script"), desc);
   if (stat(oldscriptpath,&stab)) {
     if (errno == ENOENT) {
       debug(dbg_scripts,"maintainer_script_alternative nonexistent %s `%s'",
@@ -431,7 +431,7 @@ int maintainer_script_alternative(struct pkginfo *pkg,
                                                    vdew_nonambig),
                         NULL);
   strcpy(cidirrest,scriptname);
-  sprintf(buf,_("new %s script"),description);
+  sprintf(buf, _("new %s script"), desc);
 
   if (stat(cidir,&stab)) {
     if (errno == ENOENT)

+ 3 - 3
src/main.h

@@ -231,12 +231,12 @@ struct filenamenode *namenodetouse(struct filenamenode*, struct pkginfo*);
 
 /* all ...'s are const char*'s ... */
 int maintainer_script_installed(struct pkginfo *pkg, const char *scriptname,
-                                const char *description, ...);
+                                const char *desc, ...);
 int maintainer_script_new(struct pkginfo *pkg,
-			  const char *scriptname, const char *description,
+                          const char *scriptname, const char *desc,
                           const char *cidir, char *cidirrest, ...);
 int maintainer_script_alternative(struct pkginfo *pkg,
-                                  const char *scriptname, const char *description,
+                                  const char *scriptname, const char *desc,
                                   const char *cidir, char *cidirrest,
                                   const char *ifok, const char *iffallback);