- /* first try busybox tftp args */
-
- p = argv;
- *p++ = pb_system_apps.tftp; /* 1 */
- *p++ = "-g"; /* 2 */
- *p++ = "-l"; /* 3 */
- *p++ = local; /* 4 */
- *p++ = "-r"; /* 5 */
- *p++ = url->path; /* 6 */
- *p++ = url->host; /* 7 */
- if (url->port)
- *p++ = url->port; /* 8 */
- *p++ = NULL; /* 9 */
- } else {
- p = argv;
- *p++ = pb_system_apps.tftp; /* 1 */
- *p++ = "-m"; /* 2 */
- *p++ = "binary"; /* 3 */
- *p++ = url->host; /* 4 */
- if (url->port)
- *p++ = url->port; /* 5 */
- *p++ = "-c"; /* 6 */
- *p++ = "get"; /* 7 */
- *p++ = url->path; /* 8 */
- *p++ = local; /* 9 */
- *p++ = NULL; /* 10 */
- }
-
- if (url_data) {
- process = process_create(ctx);
-
- process->path = pb_system_apps.tftp;
- process->argv = argv;
- process->exit_cb = load_url_exit_cb;
- process->data = url_data;
-
- result = process_run_async(process);
- } else {
- result = process_run_simple_argv(ctx, argv);
- }
-
- if (!result)
- return local;
-
- talloc_free(local);
- return NULL;
+ argv[1] = "-g";
+ argv[2] = "-l";
+ argv[3] = NULL; /* 3: local file */
+ argv[4] = "-r";
+ argv[5] = task->url->path;
+ argv[6] = task->url->host;
+ argv[7] = port;
+ argv[8] = NULL;
+
+ load_process_to_local_file(task, argv, 3);
+
+ } else if (tftp_type == TFTP_TYPE_HPA) {
+ argv[1] = "-m";
+ argv[2] = "binary";
+ argv[3] = task->url->host;
+ argv[4] = port;
+ argv[5] = "-c";
+ argv[6] = "get";
+ argv[7] = task->url->path;
+ argv[8] = NULL; /* 8: local file */
+ argv[9] = NULL;
+ load_process_to_local_file(task, argv, 8);
+
+ } else
+ task->result->status = LOAD_ERROR;